diff --git a/aspnet-core/LINGYUN.MicroService.Aspire.slnx b/aspnet-core/LINGYUN.MicroService.Aspire.slnx index 5b8b57cbc..809d5d087 100644 --- a/aspnet-core/LINGYUN.MicroService.Aspire.slnx +++ b/aspnet-core/LINGYUN.MicroService.Aspire.slnx @@ -170,13 +170,6 @@ - - - - - - - diff --git a/aspnet-core/LINGYUN.MicroService.SingleProject.slnx b/aspnet-core/LINGYUN.MicroService.SingleProject.slnx index ee04e035f..da6c9a2ad 100644 --- a/aspnet-core/LINGYUN.MicroService.SingleProject.slnx +++ b/aspnet-core/LINGYUN.MicroService.SingleProject.slnx @@ -14,10 +14,6 @@ - - - - @@ -155,7 +151,6 @@ - @@ -347,8 +342,6 @@ - - diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs index a28332885..cecd70289 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs +++ b/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.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)) diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs index 02f716a52..4c568f4bc 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs +++ b/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) diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/DataSeeds/NotificationDataSeeder.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/DataSeeds/NotificationDataSeeder.cs index bd9c2b459..59a2e1d4f 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/DataSeeds/NotificationDataSeeder.cs +++ b/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 + data: new Dictionary { { "name", adminUserName }, { "email", adminEmailAddress }, diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/LINGYUN.Abp.MicroService.MessageService.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/LINGYUN.Abp.MicroService.MessageService.csproj index a75d21285..278615940 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/LINGYUN.Abp.MicroService.MessageService.csproj +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/LINGYUN.Abp.MicroService.MessageService.csproj @@ -78,7 +78,6 @@ - diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/MessageServiceModule.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/MessageServiceModule.cs index 63da337c4..553806c7f 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/MessageServiceModule.cs +++ b/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), diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService.EntityFrameworkCore/TaskServiceDataSeeder.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService.EntityFrameworkCore/TaskServiceDataSeeder.cs index 85af7f482..b9c73f4ad 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService.EntityFrameworkCore/TaskServiceDataSeeder.cs +++ b/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!, }; } } diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/LINGYUN.Abp.MicroService.WebhookService.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/LINGYUN.Abp.MicroService.WebhookService.csproj index b3ddc7b15..b7c147c12 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/LINGYUN.Abp.MicroService.WebhookService.csproj +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/LINGYUN.Abp.MicroService.WebhookService.csproj @@ -64,7 +64,6 @@ - diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/WebhookServiceModule.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/WebhookServiceModule.cs index 902aabb14..581a35fae 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/WebhookServiceModule.cs +++ b/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), diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj index 3171e6528..6a8af9143 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj @@ -12,7 +12,6 @@ - @@ -74,7 +73,6 @@ - diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs index 686e785ad..7fe8f244e 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs +++ b/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), }; diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs index 97fe61542..830665db6 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs +++ b/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), diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLoggingIndexInitializer.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLoggingIndexInitializer.cs index cc269932f..e9571626c 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLoggingIndexInitializer.cs +++ b/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()); } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs index bd5beee38..da5aa1dd0 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs +++ b/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 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> 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 GetAsync( + public async virtual Task GetAsync( Guid id, bool includeDetails = false, CancellationToken cancellationToken = default) @@ -212,14 +212,14 @@ public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependen protected virtual List 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(); } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogWriter.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogWriter.cs index c88aa3d51..3e30cbf3a 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogWriter.cs +++ b/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); } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchEntityChangeStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchEntityChangeStore.cs index 6d17c8dc4..2eb6844e5 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchEntityChangeStore.cs +++ b/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.Instance; } - public async virtual Task GetAsync( + public async virtual Task 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> 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 GetWithUsernameAsync( + public async virtual Task 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(); diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs index 5a5a72930..505f0e238 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs +++ b/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.Instance; } - public async virtual Task GetAsync( + public async virtual Task GetAsync( Guid id, bool includeDetails = false, CancellationToken cancellationToken = default) @@ -80,19 +80,19 @@ public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDe } public async virtual Task> 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 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 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(); @@ -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(); } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogWriter.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogWriter.cs index 20f9e56b0..fc087a511 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogWriter.cs +++ b/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); } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs index c803e4525..28cad7b10 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs +++ b/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 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> 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>(auditLogs); } - public async virtual Task GetAsync( + public async virtual Task GetAsync( Guid id, bool includeDetails = false, CancellationToken cancellationToken = default) diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/EntityChangeStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/EntityChangeStore.cs index 948dbe0ad..e6e99d5d9 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/EntityChangeStore.cs +++ b/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 GetAsync( + public async virtual Task 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> 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>(entityChanges); } - public async virtual Task GetWithUsernameAsync( + public async virtual Task GetWithUsernameAsync( Guid entityChangeId, CancellationToken cancellationToken = default) { diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs index 00df36963..c3b94df0e 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs +++ b/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 GetAsync( + public async virtual Task GetAsync( Guid id, bool includeDetails = false, CancellationToken cancellationToken = default) @@ -56,19 +56,19 @@ public class SecurityLogManager : ISecurityLogManager, ITransientDependency } public async virtual Task> 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 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( diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs index 9e4d402b5..6a82dc0bf 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs +++ b/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; } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLoggingQueue.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLoggingQueue.cs index 3b615f6f2..bf1e6b013 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLoggingQueue.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLoggingQueue.cs @@ -14,7 +14,7 @@ public abstract class AuditLoggingQueue 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( diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs index ca4e70eca..e2efa0d7d 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs +++ b/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 GetAsync( + public virtual Task 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) diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs index 31c13577d..734e1dc60 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs +++ b/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()); } - public Task GetWithUsernameAsync(Guid entityChangeId, CancellationToken cancellationToken = default) + public Task GetWithUsernameAsync(Guid entityChangeId, CancellationToken cancellationToken = default) { EntityChangeWithUsername? entityChange = null; - return Task.FromResult(entityChange!); + return Task.FromResult(entityChange); } public Task> GetWithUsernameAsync(string entityId, string entityTypeFullName, CancellationToken cancellationToken = default) diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs index e71547840..a6cbe53ec 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs +++ b/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 GetAsync( + public virtual Task 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) diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs index 0b16aa28b..c554fa617 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs +++ b/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; } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs index 47015060a..bf2a88dac 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs +++ b/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() { diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs index f689a463b..d0838ad6b 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Abp.AuditLogging; public interface IAuditLogManager { - Task GetAsync( + Task GetAsync( Guid id, bool includeDetails = false, CancellationToken cancellationToken = default); diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs index f2fb5d31c..d6dc4360b 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs +++ b/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 GetWithUsernameAsync( + Task GetWithUsernameAsync( Guid entityChangeId, CancellationToken cancellationToken = default); diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs index e031c0b51..eb49bd055 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.AuditLogging; public interface ISecurityLogManager { - Task GetAsync( + Task GetAsync( Guid id, bool includeDetails = false, CancellationToken cancellationToken = default); diff --git a/aspnet-core/framework/calendars/LINGYUN.Abp.Calendar/LINGYUN/Abp/Calendar/WorkdayCalendarInfo.cs b/aspnet-core/framework/calendars/LINGYUN.Abp.Calendar/LINGYUN/Abp/Calendar/WorkdayCalendarInfo.cs index 07ab09520..1c8a1cd68 100644 --- a/aspnet-core/framework/calendars/LINGYUN.Abp.Calendar/LINGYUN/Abp/Calendar/WorkdayCalendarInfo.cs +++ b/aspnet-core/framework/calendars/LINGYUN.Abp.Calendar/LINGYUN/Abp/Calendar/WorkdayCalendarInfo.cs @@ -10,7 +10,7 @@ public class WorkdayCalendarInfo /// /// 日历名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 默认日历 /// @@ -18,7 +18,7 @@ public class WorkdayCalendarInfo /// /// 工作日范围 /// - public DayOfWeek[] Workdays { get; set; } + public DayOfWeek[] Workdays { get; set; } = default!; /// /// 工作时间范围 /// diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs index 8533d6ed0..2c4ed91bc 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs +++ b/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() diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs index 3e6e85705..ffd0fd120 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs @@ -16,7 +16,7 @@ public class TencentBlobProviderConfiguration /// /// 区域 /// - public string Region { + public string? Region { get => _containerConfiguration.GetConfiguration(TencentBlobProviderConfigurationNames.Region); set => _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.Region, value); } @@ -39,7 +39,7 @@ public class TencentBlobProviderConfiguration /// /// 创建命名空间时防盗链列表 /// - public List CreateBucketReferer { + public List? CreateBucketReferer { get => _containerConfiguration.GetConfigurationOrDefault(TencentBlobProviderConfigurationNames.CreateBucketReferer, new List()); set { if (value == null) diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentCloudBlobProvider.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentCloudBlobProvider.cs index 11b6e09fc..cb7aced85 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentCloudBlobProvider.cs +++ b/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 GetOrNullAsync(BlobProviderGetArgs args) + public override async Task 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 refererList = null) + protected async virtual Task CreateBucketIfNotExists(CosXml cos, BlobProviderArgs args, IList? refererList = null) { if (!await BucketExistsAsync(cos, args)) { diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs index c7c8ecf47..ec202f755 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs +++ b/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 templateParams = null) + IDictionary? 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 templateParams = null) + IDictionary? templateParams = null) { var smsMessage = new SmsMessage(phoneNumber, nameof(TencentCloudSmsSender)); smsMessage.Properties.Add("SignName", signName); diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQCacheItem.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQCacheItem.cs index 1d63a72f4..9ad8c5d75 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQCacheItem.cs +++ b/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() { diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptions.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptions.cs index 85bb416a9..7fd1ef4d6 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptions.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptions.cs @@ -8,14 +8,14 @@ public class AbpTencentQQOptions /// /// see: https://wiki.connect.qq.com/%e5%87%86%e5%a4%87%e5%b7%a5%e4%bd%9c_oauth2-0 /// - public string AppId { get; set; } + public string AppId { get; set; } = default!; /// /// 在QQ互联上申请的AppKey /// /// /// see: https://wiki.connect.qq.com/%e5%87%86%e5%a4%87%e5%b7%a5%e4%bd%9c_oauth2-0 /// - public string AppKey { get; set; } + public string AppKey { get; set; } = default!; /// /// 是否移动端样式 /// diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsManager.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsManager.cs index c202de39a..c16b57421 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsManager.cs +++ b/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 GetCacheItemAsync() { var cacheKey = AbpTencentQQCacheItem.CalculateCacheKey(); + var cacheItem = TencentCache.Get(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; } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingAppService.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingAppService.cs index 2cb8616aa..c2c39a507 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingAppService.cs +++ b/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 GetAllForProviderAsync(string providerName, string providerKey) + protected async virtual Task 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, diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbstractTencentCloudClientFactory.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbstractTencentCloudClientFactory.cs index 3f4faa3e9..717aaebf0 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbstractTencentCloudClientFactory.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbstractTencentCloudClientFactory.cs @@ -31,37 +31,39 @@ public abstract class AbstractTencentCloudClientFactory protected async virtual Task GetClientCacheItemAsync() { - return await ClientCache.GetOrCreateAsync( - TencentCloudClientCacheItem.CalculateCacheKey("client-options"), - async (cache) => + var cacheKey = TencentCloudClientCacheItem.CalculateCacheKey("client-options"); + var cacheItem = ClientCache.Get(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 protected async virtual Task GetClientCacheItemAsync() { - return await ClientCache.GetOrCreateAsync( - TencentCloudClientCacheItem.CalculateCacheKey("client-options"), - async (cache) => + var cacheKey = TencentCloudClientCacheItem.CalculateCacheKey("client-options"); + var cacheItem = ClientCache.Get(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; } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientCacheItem.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientCacheItem.cs index 40c59e7ed..1935a6d21 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientCacheItem.cs +++ b/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; } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientFactory.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientFactory.cs index 141d573f9..56e0c4dff 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientFactory.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/TencentCloudClientFactory.cs @@ -46,7 +46,7 @@ public class TencentCloudClientFactory : 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"); diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN/Abp/AspNetCore/WebClientInfo/RequestForwardedHeaderWebClientInfoProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN/Abp/AspNetCore/WebClientInfo/RequestForwardedHeaderWebClientInfoProvider.cs index d30e700c0..199c4a71e 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN/Abp/AspNetCore/WebClientInfo/RequestForwardedHeaderWebClientInfoProvider.cs +++ b/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) && diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs index a1ed81a40..bdbdcff7b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs +++ b/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() diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/AbpExceptionHandlingWrapperMiddleware.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/AbpExceptionHandlingWrapperMiddleware.cs index 7f4568163..f88dc2ba6 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/AbpExceptionHandlingWrapperMiddleware.cs +++ b/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)); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/HttpResponseWrapperContext.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/HttpResponseWrapperContext.cs index e7f6e3624..605311e8f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN/Abp/AspNetCore/Wrapper/HttpResponseWrapperContext.cs +++ b/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 httpHeaders = null) + IDictionary? httpHeaders = null) { HttpContext = httpContext; HttpStatusCode = httpStatusCode; diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs index 4aa760801..7c154be14 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs +++ b/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 GetOrNullAsync(BlobProviderGetArgs args) + public override async Task GetOrNullAsync(BlobProviderGetArgs args) { using var ossClient = await GetOssClientAsync(args); var blobName = AliyunBlobNameCalculator.Calculate(args); diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs index 8cdf5e126..95d0f5740 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs @@ -34,7 +34,7 @@ public class AliyunBlobProviderConfiguration /// 签名版本(可选项:v1、v4) /// 默认: v1 /// - 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 /// /// 创建命名空间时防盗链列表 /// - public List CreateBucketReferer + public List? CreateBucketReferer { get => _containerConfiguration.GetConfigurationOrDefault(AliyunBlobProviderConfigurationNames.CreateBucketReferer, new List()); set @@ -85,7 +85,7 @@ public class AliyunBlobProviderConfiguration set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.PresignedGetExpirySeconds, value); } - public string Endpoint { + public string? Endpoint { get => _containerConfiguration.GetConfigurationOrDefault(AliyunBlobProviderConfigurationNames.Endpoint, null); set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.Endpoint, value); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs b/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs index 3924bc4de..9a8d95d1b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs +++ b/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(); - string connectionString = null; + string? connectionString = null; if (_currentTenant.IsAvailable) { var connectionStringResolver = _serviceProvider.GetRequiredService(); @@ -57,10 +57,10 @@ public class DefaultDbSchemaMigrator : IDbSchemaMigrator, ITransientDependency return; } - connectionString??= defaultConnectionString; + connectionString ??= defaultConnectionString; var dbContextBuilder = new DbContextOptionsBuilder(); - using var dbContext = configureDbContext(connectionString, dbContextBuilder); + using var dbContext = configureDbContext(connectionString!, dbContextBuilder); await dbContext.Database.MigrateAsync(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPBootstrapper.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPBootstrapper.cs index 0208f411d..98dfd3f00 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPBootstrapper.cs +++ b/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 _logger; private readonly IServiceProvider _serviceProvider; - private CancellationTokenSource _cts; + private CancellationTokenSource? _cts; private bool _disposed; private IEnumerable _processors = default!; diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPConsumerServiceSelector.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPConsumerServiceSelector.cs index 4dec7cf1f..63064307c 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPConsumerServiceSelector.cs +++ b/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(true); + var topicAttr = method!.GetCustomAttributes(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(); diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPMessageExtensions.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPMessageExtensions.cs index b4745f073..924c6f1af 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPMessageExtensions.cs +++ b/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 /// 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 /// /// /// - public static string GetCorrelationIdOrNull(this Message message) + public static string? GetCorrelationIdOrNull(this Message message) { if (message.TryGetCorrelationId(out var correlationId)) { diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPSubscribeInvoker.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPSubscribeInvoker.cs index 91398617a..243fd8b54 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPSubscribeInvoker.cs +++ b/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(); - 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 callbackHeader = null; + IDictionary? 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 /// /// /// - private async Task ExecuteWithParameterAsync(ObjectMethodExecutor executor, object @class, object[] parameter) + private async Task ExecuteWithParameterAsync(ObjectMethodExecutor executor, object @class, object?[]? parameter) { if (executor.IsMethodAsync) { diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCapSerializer.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCapSerializer.cs index 5c6221ac6..b7cf6798c 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCapSerializer.cs +++ b/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 DeserializeAsync(TransportMessage transportMessage, Type valueType) + public ValueTask DeserializeAsync(TransportMessage transportMessage, Type? valueType) { if (valueType == null || ReadOnlyMemory.Empty.Equals(transportMessage.Body) || transportMessage.Body.Length == 0) { @@ -67,7 +67,7 @@ public class AbpCapSerializer : ISerializer // return JsonSerializer.Deserialize(json, _jsonSerializerOptions.JsonSerializerOptions); } - public object Deserialize(object value, Type valueType) + public object? Deserialize(object value, Type valueType) { if (value is JsonElement jToken) { diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CAPDistributedEventBus.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CAPDistributedEventBus.cs index 899812e64..1a2456ba6 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CAPDistributedEventBus.cs +++ b/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(); + var headers = new Dictionary(); if (messageId.HasValue) { headers.TryAdd(AbpCAPHeaders.MessageId, messageId.ToString()); diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CustomDistributedEventSubscriber.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CustomDistributedEventSubscriber.cs index d34eb8882..9f98d4104 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CustomDistributedEventSubscriber.cs +++ b/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(true); + var topicAttr = method!.GetCustomAttributes(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(); diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/AwaitableInfo.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/AwaitableInfo.cs index 65354ea5c..116f3e789 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/AwaitableInfo.cs +++ b/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 \ No newline at end of file diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/CoercedAwaitableInfo.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/CoercedAwaitableInfo.cs index 7923f8eb8..a7cf46b92 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/CoercedAwaitableInfo.cs +++ b/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 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/ObjectMethodExecutorFSharpSupport.cs b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/ObjectMethodExecutorFSharpSupport.cs index 8ea65340d..34c406599 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/Internal/ObjectMethodExecutorFSharpSupport.cs +++ b/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 /// /// Helper for detecting whether a given type is FSharpAsync`1, and if so, supplying /// an 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 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailExceptionHandlingOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailExceptionHandlingOptions.cs index cd5aab91e..cef4315d9 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailExceptionHandlingOptions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailExceptionHandlingOptions.cs @@ -12,19 +12,19 @@ public class AbpEmailExceptionHandlingOptions /// /// 默认邮件标题 /// - public string DefaultTitle { get; set; } + public string? DefaultTitle { get; set; } /// /// 默认邮件内容头 /// - public string DefaultContentHeader { get; set; } + public string? DefaultContentHeader { get; set; } /// /// 默认邮件内容底 /// - public string DefaultContentFooter { get; set; } + public string? DefaultContentFooter { get; set; } /// /// 默认异常收件人 /// - public string DefaultReceiveEmail { get; set; } + public string? DefaultReceiveEmail { get; set; } /// /// 异常类型指定收件人处理映射列表 /// @@ -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; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionSubscriberBase.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionSubscriberBase.cs index 436de36b9..ece7f9f6a 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionSubscriberBase.cs +++ b/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(); + protected ILoggerFactory? LoggerFactory => ServiceProvider.LazyGetService(); protected ILogger Logger => _lazyLogger.Value; - private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); + private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName!) ?? NullLogger.Instance, true); protected AbpExceptionSubscriberBase( diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpRedisRequiresLimitFeatureOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpRedisRequiresLimitFeatureOptions.cs index 2a068ff32..e89be98c7 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpRedisRequiresLimitFeatureOptions.cs +++ b/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 { - 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.Value { get { return this; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisRequiresLimitFeatureChecker.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisRequiresLimitFeatureChecker.cs index ab439cead..85351cc12 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisRequiresLimitFeatureChecker.cs +++ b/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 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; diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs index 1466632f2..3f0c832c5 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs +++ b/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 GetRequiresLimitFeature(MethodInfo methodInfo) + protected async virtual Task GetRequiresLimitFeature(MethodInfo methodInfo) { var limitFeature = methodInfo.GetCustomAttribute(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; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentCheckContext.cs b/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentCheckContext.cs index 8b1378758..1e832b0dd 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentCheckContext.cs +++ b/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 ArgumentsDictionary { get; } + public IReadOnlyDictionary? ArgumentsDictionary { get; } public IdempotentCheckContext( Type target, MethodInfo method, string idempotentKey, - IReadOnlyDictionary? argumentsDictionary) + IReadOnlyDictionary? argumentsDictionary) { Target = target; Method = method; IdempotentKey = idempotentKey; - ArgumentsDictionary = argumentsDictionary ?? new Dictionary(); + ArgumentsDictionary = argumentsDictionary ?? new Dictionary(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentChecker.cs b/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentChecker.cs index 214c1cbbc..14ebe7187 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentChecker.cs +++ b/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) { diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentInterceptor.cs b/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentInterceptor.cs index 6d1ae30d7..3ee018130 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentInterceptor.cs +++ b/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, diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentKeyNormalizer.cs b/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentKeyNormalizer.cs index a15153baf..199f31181 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentKeyNormalizer.cs +++ b/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]; diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentKeyNormalizerContext.cs b/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentKeyNormalizerContext.cs index 7815fca23..33463b580 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN/Abp/Idempotent/IdempotentKeyNormalizerContext.cs +++ b/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 ArgumentsDictionary { get; } + public IReadOnlyDictionary? ArgumentsDictionary { get; } public IdempotentKeyNormalizerContext( Type target, MethodInfo method, - IReadOnlyDictionary? argumentsDictionary) + IReadOnlyDictionary? argumentsDictionary) { Target = target; Method = method; - ArgumentsDictionary = argumentsDictionary ?? new Dictionary(); + ArgumentsDictionary = argumentsDictionary ?? new Dictionary(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpClient.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpClient.cs index b18b4fe41..46d6f0af8 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpClient.cs +++ b/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(responseContent); + var baiduLocationResponse = JsonConvert.DeserializeObject(responseContent)!; if (!baiduLocationResponse.IsSuccess()) { var localizerFactory = ServiceProvider.GetRequiredService(); @@ -84,7 +84,7 @@ public class BaiduLocationHttpClient : ITransientDependency return location; } - public async virtual Task GeocodeAsync(string address, string city = null) + public async virtual Task GeocodeAsync(string address, string? city = null) { var requestParamters = new Dictionary { @@ -106,7 +106,7 @@ public class BaiduLocationHttpClient : ITransientDependency } var requestUrl = BuildRequestUrl(baiduMapUrl, baiduMapPath, requestParamters); var responseContent = await MakeRequestAndGetResultAsync(requestUrl); - var baiduLocationResponse = JsonConvert.DeserializeObject(responseContent); + var baiduLocationResponse = JsonConvert.DeserializeObject(responseContent)!; if (!baiduLocationResponse.IsSuccess()) { var localizerFactory = ServiceProvider.GetRequiredService(); @@ -157,7 +157,7 @@ public class BaiduLocationHttpClient : ITransientDependency var requestUrl = BuildRequestUrl(baiduMapUrl, baiduMapPath, requestParamters); var responseContent = await MakeRequestAndGetResultAsync(requestUrl); - var baiduLocationResponse = JsonConvert.DeserializeObject(responseContent); + var baiduLocationResponse = JsonConvert.DeserializeObject(responseContent)!; if (!baiduLocationResponse.IsSuccess()) { var localizerFactory = ServiceProvider.GetRequiredService(); @@ -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); diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationOptions.cs index ff409dc19..d24f6e8c5 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationOptions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationOptions.cs @@ -7,11 +7,11 @@ public class BaiduLocationOptions /// /// 用户申请注册的key /// - public string AccessKey { get; set; } + public string AccessKey { get; set; } = default!; /// /// 用户申请注册的AccessSecret /// - public string AccessSecret { get; set; } + public string AccessSecret { get; set; } = default!; /// /// 坐标的类型,目前支持的坐标类型包括: /// bd09ll(百度经纬度坐标) diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationResolveProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationResolveProvider.cs index cd9eaaa84..270144575 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationResolveProvider.cs +++ b/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 GeocodeAsync(string address, string city = null) + public async virtual Task GeocodeAsync(string address, string? city = null) { return await BaiduLocationHttpClient.GeocodeAsync(address, city); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressComponent.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressComponent.cs index 07af4a383..66f7bec6f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressComponent.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressComponent.cs @@ -11,7 +11,7 @@ public class AddressComponent /// /// 国家 /// - public string Country { get; set; } + public string? Country { get; set; } /// /// 国家国家编码 /// @@ -23,21 +23,21 @@ public class AddressComponent /// [JsonProperty("country_code_iso")] [JsonPropertyName("country_code_iso")] - public string CountryCodeIso { get; set; } + public string? CountryCodeIso { get; set; } /// /// 国家英文缩写(两位) /// [JsonProperty("country_code_iso2")] [JsonPropertyName("country_code_iso2")] - public string CountryCodeIso2 { get; set; } + public string? CountryCodeIso2 { get; set; } /// /// 省名 /// - public string Province { get; set; } + public string? Province { get; set; } /// /// 城市名 /// - public string City { get; set; } + public string? City { get; set; } /// /// 城市所在级别(仅国外有参考意义。 /// 国外行政区划与中国有差异,城市对应的层级不一定为『city』。 @@ -49,37 +49,37 @@ public class AddressComponent /// /// 区县名 /// - public string District { get; set; } + public string? District { get; set; } /// /// 乡镇名 /// - public string Town { get; set; } + public string? Town { get; set; } /// /// 乡镇id /// [JsonProperty("town_code")] [JsonPropertyName("town_code")] - public string TownCode { get; set; } + public string? TownCode { get; set; } /// /// 街道名(行政区划中的街道层级) /// - public string Street { get; set; } + public string? Street { get; set; } /// /// 街道门牌号 /// [JsonProperty("street_number")] [JsonPropertyName("street_number")] - public string StreetNumber { get; set; } + public string? StreetNumber { get; set; } /// /// 行政区划代码 /// - public string AdCode { get; set; } + public string? AdCode { get; set; } /// /// 相对当前坐标点的方向,当有门牌号的时候返回数据 /// - public string Direction { get; set; } + public string? Direction { get; set; } /// /// 相对当前坐标点的距离,当有门牌号的时候返回数据 /// - public string Distance { get; set; } + public string? Distance { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressDetail.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressDetail.cs index dddf20a51..17dd03ef1 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressDetail.cs +++ b/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; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduGeocode.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduGeocode.cs index 90bff8157..5659ceaa8 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduGeocode.cs +++ b/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; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduPoi.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduPoi.cs index 52ea4df4b..e3c4069b6 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduPoi.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduPoi.cs @@ -10,23 +10,23 @@ public class BaiduPoi /// [JsonProperty("addr")] [JsonPropertyName("addr")] - public string Address { get; set; } + public string Address { get; set; } = default!; /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 标记 /// - public string Tag { get; set; } + public string? Tag { get; set; } /// /// 和当前坐标点的方向 /// - public string Direction { get; set; } + public string? Direction { get; set; } /// /// 离坐标点距离 /// - public string Distance { get; set; } + public string? Distance { get; set; } /// /// poi坐标{x,y} /// @@ -35,28 +35,28 @@ public class BaiduPoi /// /// 坐标类型 /// - public string PoiType { get; set; } + public string? PoiType { get; set; } /// /// 电话 /// [JsonProperty("tel")] [JsonPropertyName("tel")] - public string TelPhone { get; set; } + public string? TelPhone { get; set; } /// /// poi唯一标识 /// - public string Uid { get; set; } + public string Uid { get; set; } = default!; /// /// 邮编 /// [JsonProperty("zip")] [JsonPropertyName("zip")] - public string Post { get; set; } + public string? Post { get; set; } /// /// poi对应的主点poi(如,海底捞的主点为上地华联,该字段则为上地华联的poi信息。 /// 如无,该字段为空),包含子字段和pois基础召回字段相同。 /// [JsonProperty("parent_poi")] [JsonPropertyName("parent_poi")] - public BaiduPoi ParentPoi { get; set; } + public BaiduPoi? ParentPoi { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduReGeocode.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduReGeocode.cs index 5b168328d..fec71f62f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduReGeocode.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduReGeocode.cs @@ -11,22 +11,22 @@ public class BaiduReGeocode /// [JsonProperty("location")] [JsonPropertyName("location")] - public BaiduLocation Location { get; set; } + public BaiduLocation Location { get; set; } = default!; /// /// 结构化地址信息 /// [JsonProperty("formatted_address")] [JsonPropertyName("formatted_address")] - public string FormattedAddress { get; set; } + public string? FormattedAddress { get; set; } /// /// 坐标所在商圈信息,如 "人民大学,中关村,苏州街"。 /// 最多返回3个。 /// - public string Business { get; set; } + public string? Business { get; set; } /// /// 地址元素列表 /// - public AddressComponent AddressComponent { get; set; } + public AddressComponent? AddressComponent { get; set; } /// /// 周边poi数组 /// @@ -44,7 +44,7 @@ public class BaiduReGeocode /// [JsonProperty("sematic_description")] [JsonPropertyName("sematic_description")] - public string SematicDescription { get; set; } + public string? SematicDescription { get; set; } public BaiduReGeocode() { AddressComponent = new AddressComponent(); diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduRoad.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduRoad.cs index f760c0d68..25900a42b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduRoad.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduRoad.cs @@ -5,9 +5,9 @@ /// public class BaiduRoad { - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 传入的坐标点距离道路的大概距离 /// - public string Distance { get; set; } + public string? Distance { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Content.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Content.cs index 57cce12e7..0bd569535 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Content.cs +++ b/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")] diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/IpPoint.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/IpPoint.cs index 6bc9e3458..b9b73be57 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/IpPoint.cs +++ b/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() { diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/PoiRegion.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/PoiRegion.cs index e83c8078b..94540f5cb 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/PoiRegion.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/PoiRegion.cs @@ -11,23 +11,23 @@ public class PoiRegion /// /// 归属区域面名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 归属区域面类型 /// - public string Tag { get; set; } + public string? Tag { get; set; } /// /// 请求中的坐标与所归属区域面的相对位置关系 /// [JsonProperty("direction_desc")] [JsonPropertyName("direction_desc")] - public string DirectionDesc { get; set; } + public string? DirectionDesc { get; set; } /// /// poi唯一标识 /// - public string Uid { get; set; } + public string Uid { get; set; } = default!; /// /// 离坐标点距离 /// - public string Distance { get; set; } + public string? Distance { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduIpGeocodeResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduIpGeocodeResponse.cs index f0bc247f1..60df1a613 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduIpGeocodeResponse.cs +++ b/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(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressComponent.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressComponent.cs index fbf9994bb..21b9cd0f6 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressComponent.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressComponent.cs @@ -11,30 +11,30 @@ public class AddressComponent /// 国家 /// [JsonProperty("nation")] - public string Nation { get; set; } + public string? Nation { get; set; } /// /// 省 /// [JsonProperty("province")] - public string Province { get; set; } + public string? Province { get; set; } /// /// 市 /// [JsonProperty("city")] - public string City { get; set; } + public string? City { get; set; } /// /// 区,可能为空字串 /// [JsonProperty("district")] - public string District { get; set; } + public string? District { get; set; } /// /// 街道,可能为空字串 /// [JsonProperty("street")] - public string Street { get; set; } + public string? Street { get; set; } /// /// 门牌,可能为空字串 /// [JsonProperty("street_number")] - public string StreetNumber { get; set; } + public string? StreetNumber { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressInfo.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressInfo.cs index 5d148e77d..281734c5c 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressInfo.cs +++ b/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!; /// /// 城市代码 /// [JsonProperty("city_code")] - public string CityCode { get; set; } + public string? CityCode { get; set; } /// /// 行政区划代码 /// [JsonProperty("nation_code")] - public string NationCode { get; set; } + public string? NationCode { get; set; } /// /// 行政区划名称 /// [JsonProperty("name")] - public string Name { get; set; } + public string? Name { get; set; } /// /// 国家 /// [JsonProperty("nation")] - public string Nation { get; set; } + public string? Nation { get; set; } /// /// 省/直辖市 /// [JsonProperty("province")] - public string Province { get; set; } + public string? Province { get; set; } /// /// 市/地级区 及同级行政区划 /// [JsonProperty("city")] - public string City { get; set; } + public string? City { get; set; } /// /// 区/县级市 及同级行政区划 /// [JsonProperty("district")] - public string District { get; set; } + public string? District { get; set; } /// /// 行政区划中心点坐标 /// diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Area.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Area.cs index 61efdf0d1..bc62fa991 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Area.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Area.cs @@ -11,12 +11,12 @@ public class Area /// 地点唯一标识 /// [JsonProperty("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; /// /// 名称/标题 /// [JsonProperty("title")] - public string Title { get; set; } + public string? Title { get; set; } /// /// 坐标 /// @@ -26,11 +26,11 @@ public class Area /// 此参考位置到输入坐标的直线距离 /// [JsonProperty("_distance")] - public string Distance { get; set; } + public string? Distance { get; set; } /// /// 此参考位置到输入坐标的方位关系, /// 如:北、南、内 /// [JsonProperty("_dir_desc")] - public string DirDescription { get; set; } + public string? DirDescription { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/FormattedAddress.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/FormattedAddress.cs index e1967f86c..c3d243b28 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/FormattedAddress.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/FormattedAddress.cs @@ -11,10 +11,10 @@ public class FormattedAddress /// 经过腾讯地图优化过的描述方式,更具人性化特点 /// [JsonProperty("recommend")] - public string ReCommend { get; set; } + public string? ReCommend { get; set; } /// /// 大致位置,可用于对位置的粗略描述 /// [JsonProperty("rough")] - public string Rough { get; set; } + public string? Rough { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Poi.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Poi.cs index 8c2dc429c..da034642e 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Poi.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Poi.cs @@ -11,22 +11,22 @@ public class Poi /// 地点唯一标识 /// [JsonProperty("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; /// /// 名称/标题 /// [JsonProperty("title")] - public string Title { get; set; } + public string Title { get; set; } = default!; /// /// 地址 /// [JsonProperty("address")] - public string Address { get; set; } + public string Address { get; set; } = default!; /// /// POI分类 /// [JsonProperty("category")] - public string CateGory { get; set; } + public string CateGory { get; set; } = default!; /// /// 坐标 /// diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentGeocode.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentGeocode.cs index 81cf958f2..a26108583 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentGeocode.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentGeocode.cs @@ -39,5 +39,5 @@ public class GeocodeAddressInfo /// 行政区划代码 /// [JsonProperty("adcode")] - public string AdCode { get; set; } + public string AdCode { get; set; } = default!; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentIPGeocode.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentIPGeocode.cs index 3a522602b..be622aa76 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentIPGeocode.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentIPGeocode.cs @@ -11,7 +11,7 @@ public class TencentIPGeocode /// 用于定位的IP地址 /// [JsonProperty("ip")] - public string IpAddress { get; set; } + public string IpAddress { get; set; } = default!; /// /// 定位坐标 /// diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentReGeocode.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentReGeocode.cs index 935daad99..ea49d58d1 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentReGeocode.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentReGeocode.cs @@ -11,7 +11,7 @@ public class TencentReGeocode /// 地址描述 /// [JsonProperty("address")] - public string Address { get; set; } + public string? Address { get; set; } /// /// 位置描述 /// diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentLocationResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentLocationResponse.cs index 818307449..02c4fca87 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentLocationResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentLocationResponse.cs @@ -20,12 +20,12 @@ public abstract class TencentLocationResponse /// 状态说明 /// [JsonProperty("message")] - public string Message { get; set; } + public string Message { get; set; } = default!; /// /// 本次请求的唯一标识 /// [JsonProperty("request_id")] - public string RequestId { get; set; } + public string RequestId { get; set; } = default!; /// /// 是否请求成功 /// diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpClient.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpClient.cs index a0cc76b51..4a79c5920 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpClient.cs +++ b/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 IPGeocodeAsync(string ipAddress) { - var requestParamters = new Dictionary + var requestParamters = new Dictionary { { "callback", Options.Callback }, { "ip", ipAddress }, @@ -74,9 +74,9 @@ public class TencentLocationHttpClient : ITransientDependency return location; } - public async virtual Task GeocodeAsync(string address, string city = null) + public async virtual Task GeocodeAsync(string address, string? city = null) { - var requestParamters = new Dictionary + var requestParamters = new Dictionary { { "address", address }, { "callback", Options.Callback }, @@ -109,7 +109,7 @@ public class TencentLocationHttpClient : ITransientDependency public async virtual Task ReGeocodeAsync(double lat, double lng, int radius = 1000) { - var requestParamters = new Dictionary + var requestParamters = new Dictionary { { "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 GetTencentMapResponseAsync(string url, string path, IDictionary paramters) + protected async virtual Task GetTencentMapResponseAsync(string url, string path, IDictionary paramters) where TResponse : TencentLocationResponse { var requestUrl = BuildRequestUrl(url, path, paramters); var responseContent = await MakeRequestAndGetResultAsync(requestUrl); - var tencentLocationResponse = JsonConvert.DeserializeObject(responseContent); + var tencentLocationResponse = JsonConvert.DeserializeObject(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 paramters) + protected virtual string BuildRequestUrl(string uri, string path, IDictionary paramters) { var requestUrlBuilder = new StringBuilder(128); requestUrlBuilder.Append(uri); diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationOptions.cs index adb0a012b..1c4a5545b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationOptions.cs +++ b/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; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationResolveProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationResolveProvider.cs index 66e9ddfa7..cc74632c2 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationResolveProvider.cs +++ b/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 GeocodeAsync(string address, string city = null) + public async virtual Task GeocodeAsync(string address, string? city = null) { return await TencentLocationHttpClient.GeocodeAsync(address, city); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Utils/TencentSecretKeyCaculater.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Utils/TencentSecretKeyCaculater.cs index eda711878..b5ddd27ec 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Utils/TencentSecretKeyCaculater.cs +++ b/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 querystring_arrays) + private static string HttpBuildQuery(IDictionary 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 querystring_arrays) + public static string CalcSecretKey(string url, string secretKey, IDictionary querystring_arrays) { var queryString = HttpBuildQuery(querystring_arrays); diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/GecodeLocation.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/GecodeLocation.cs index 3c1007638..3afce38de 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/GecodeLocation.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/GecodeLocation.cs @@ -20,7 +20,7 @@ public class GecodeLocation : Location /// /// 能精确理解的地址类型 /// - public string Level { get; set; } + public string? Level { get; set; } /// /// 附加信息 /// diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ILocationResolveProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ILocationResolveProvider.cs index ce32988ed..6b492246c 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ILocationResolveProvider.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ILocationResolveProvider.cs @@ -6,7 +6,7 @@ public interface ILocationResolveProvider { Task IPGeocodeAsync(string ipAddress); - Task GeocodeAsync(string address, string city = null); + Task GeocodeAsync(string address, string? city = null); Task ReGeocodeAsync(double lat, double lng, int radius = 50); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/IPGecodeLocation.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/IPGecodeLocation.cs index fae5eeacf..73c0d5219 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/IPGecodeLocation.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/IPGecodeLocation.cs @@ -7,7 +7,7 @@ public class IPGecodeLocation /// /// IP地址 /// - public string IpAddress { get; set; } + public string IpAddress { get; set; } = default!; /// /// 定位坐标 /// @@ -15,23 +15,23 @@ public class IPGecodeLocation /// /// 国家 /// - public string Country { get; set; } + public string? Country { get; set; } /// /// 城市 /// - public string City { get; set; } + public string? City { get; set; } /// /// 省份 /// - public string Province { get; set; } + public string? Province { get; set; } /// /// 区县 /// - public string District { get; set; } + public string? District { get; set; } /// /// adcode /// - public string AdCode { get; set; } + public string? AdCode { get; set; } public IDictionary Additionals { get; } = new Dictionary(); diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Poi.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Poi.cs index eb22e82ec..e3525303c 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Poi.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Poi.cs @@ -2,9 +2,9 @@ public class Poi { - public string Tag { get; set; } - public string Name { get; set; } - public string Type { get; set; } - public string Address { get; set; } + public string? Tag { get; set; } + public string Name { get; set; } = default!; + public string? Type { get; set; } + public string Address { get; set; } = default!; public int? Distance { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ReGeocodeLocation.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ReGeocodeLocation.cs index ba2776cde..14c2da2a0 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ReGeocodeLocation.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ReGeocodeLocation.cs @@ -10,43 +10,43 @@ public class ReGeocodeLocation /// /// 详细地址 /// - public string Address { get; set; } + public string? Address { get; set; } /// /// 格式化的地址描述 /// - public string FormattedAddress { get; set; } + public string? FormattedAddress { get; set; } /// /// 国家 /// - public string Country { get; set; } + public string? Country { get; set; } /// /// 省份 /// - public string Province { get; set; } + public string? Province { get; set; } /// /// 城市 /// - public string City { get; set; } + public string? City { get; set; } /// /// 区县 /// - public string District { get; set; } + public string? District { get; set; } /// /// 街道 /// - public string Street { get; set; } + public string? Street { get; set; } /// /// adcode /// - public string AdCode { get; set; } + public string? AdCode { get; set; } /// /// 乡镇 /// - public string Town { get; set; } + public string? Town { get; set; } /// /// 门牌号 /// - public string Number { get; set; } + public string? Number { get; set; } /// /// Poi信息列表 /// diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Road.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Road.cs index 349fed9ed..abfa1a50e 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Road.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Road.cs @@ -2,5 +2,5 @@ public class Road { - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Localization/LocalizableStringInfo.cs b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Localization/LocalizableStringInfo.cs index ecdfc31c0..076b68f63 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Localization/LocalizableStringInfo.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Localization/LocalizableStringInfo.cs @@ -10,11 +10,11 @@ public class LocalizableStringInfo /// /// Resource name /// - public string ResourceName { get; set; } + public string ResourceName { get; set; } = default!; /// /// Properties /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// Formatted data /// @@ -35,7 +35,7 @@ public class LocalizableStringInfo public LocalizableStringInfo( string resourceName, string name, - Dictionary values = null) + Dictionary? values = null) { ResourceName = resourceName; Name = name; diff --git a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/RealTimeEto.cs b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/RealTimeEto.cs index eba868c3a..b727fc31f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/RealTimeEto.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/RealTimeEto.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Abp.RealTime; [GenericEventName(Prefix = "abp.realtime.")] public class RealTimeEto : EtoBase { - public T Data { get; set; } + public T Data { get; set; } = default!; public RealTimeEto() : base() { } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsResponse.cs index e1783065f..4a86e8c06 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsResponse.cs @@ -7,9 +7,9 @@ namespace LINGYUN.Abp.Sms.Aliyun; public class AliyunSmsResponse { - public string Code { get; set; } - public string Message { get; set; } - public string RequestId { get; set; } + public string Code { get; set; } = default!; + public string Message { get; set; } = default!; + public string RequestId { get; set; } = default!; public bool IsSuccess() { diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs index 745422f5f..57ffab45a 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs @@ -60,9 +60,12 @@ public class AliyunSmsSender : ISmsSender, IAliyunSmsVerifyCodeSender await SendAsync( new SmsVerifyCodeMessage( smsMessage.PhoneNumber, - new SmsVerifyCodeMessageParam(code.ToString(), "5"), + new SmsVerifyCodeMessageParam(code.ToString()!, "5"), signName?.ToString(), - templateCode?.ToString())); + templateCode?.ToString()) + { + Interval = 10 + }); return; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSuccessResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSuccessResponse.cs index 0aa051a3d..acf0a61e9 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSuccessResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSuccessResponse.cs @@ -2,5 +2,5 @@ public class AliyunSmsSuccessResponse : AliyunSmsResponse { - public string BizId { get; set; } + public string? BizId { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsVerifyCodeResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsVerifyCodeResponse.cs index 49d33db37..1ff2fd093 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsVerifyCodeResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsVerifyCodeResponse.cs @@ -4,11 +4,11 @@ public class AliyunSmsVerifyCodeResponse /// /// 请求状态码, OK代表请求成功 /// - public string Code { get; set; } + public string Code { get; set; } = default!; /// /// 状态码的描述 /// - public string Message { get; set; } + public string Message { get; set; } = default!; /// /// 请求是否成功 /// @@ -16,7 +16,7 @@ public class AliyunSmsVerifyCodeResponse /// /// 请求结果数据 /// - public AliyunSmsVerifyCodeModel Model { get; set; } + public AliyunSmsVerifyCodeModel Model { get; set; } = default!; } public class AliyunSmsVerifyCodeModel @@ -24,17 +24,17 @@ public class AliyunSmsVerifyCodeModel /// /// 请求Id /// - public string RequestId { get; set; } + public string RequestId { get; set; } = default!; /// /// 业务Id /// - public string BizId { get; set; } + public string? BizId { get; set; } /// /// 外部流水号 /// - public string OutId { get; set; } + public string? OutId { get; set; } /// /// 验证码, 仅当使用阿里云短信验证服务生成验证码时携带 /// - public string VerifyCode { get; set; } + public string? VerifyCode { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/SmsVerifyCodeMessage.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/SmsVerifyCodeMessage.cs index 745c9947f..747a28d21 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/SmsVerifyCodeMessage.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/SmsVerifyCodeMessage.cs @@ -4,19 +4,19 @@ public class SmsVerifyCodeMessage /// /// 方案名称,如果不填则为“默认方案”。最多不超过 20 个字符。 /// - public string SchemeName { get; set; } + public string? SchemeName { get; set; } /// /// 号码国家编码。默认为 86,目前也仅支持中国国内号码发送。 /// - public string CountryCode { get; set; } + public string? CountryCode { get; set; } /// /// 上行短信扩展码。上行短信指发送给通信服务提供商的短信,用于定制某种服务、完成查询,或是办理某种业务等,需要收费,按运营商普通短信资费进行扣费。 /// - public string SmsUpExtendCode { get; set; } + public string? SmsUpExtendCode { get; set; } /// /// 外部流水号。 /// - public string OutId { get; set; } + public string? OutId { get; set; } /// /// 验证码长度支持 4~8 位长度,默认是 4 位。 /// @@ -65,11 +65,11 @@ public class SmsVerifyCodeMessage /// /// 签名名称。暂不支持使用自定义签名,请使用系统赠送的签名。 /// - public string SignName { get; } + public string? SignName { get; } /// /// 短信模板 CODE。参数SignName选择赠送签名时,必须搭配赠送模板下发短信。您可在赠送模板配置页面选择适用您业务场景的模板。 /// - public string TemplateCode { get; } + public string? TemplateCode { get; } /// /// 短信模板参数。 /// @@ -77,8 +77,8 @@ public class SmsVerifyCodeMessage public SmsVerifyCodeMessage( string phoneNumber, SmsVerifyCodeMessageParam templateParam, - string signName = null, - string templateCode = null) + string? signName = null, + string? templateCode = null) { PhoneNumber = phoneNumber; TemplateParam = templateParam; diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/Volo/Abp/Sms/AliyunSmsSenderExtensions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/Volo/Abp/Sms/AliyunSmsSenderExtensions.cs index 2d7998ff8..089bea4ae 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/Volo/Abp/Sms/AliyunSmsSenderExtensions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/Volo/Abp/Sms/AliyunSmsSenderExtensions.cs @@ -14,7 +14,7 @@ public static class AliyunSmsSenderExtensions /// 发送手机号 /// 短信模板参数 /// - public static async Task SendAsync(this ISmsSender smsSender, string templateCode, string phoneNumber, IDictionary templateParams = null) + public static async Task SendAsync(this ISmsSender smsSender, string templateCode, string phoneNumber, IDictionary? templateParams = null) { var smsMessage = new SmsMessage(phoneNumber, nameof(AliyunSmsSender)); smsMessage.Properties.Add("TemplateCode", templateCode); @@ -34,7 +34,7 @@ public static class AliyunSmsSenderExtensions /// 发送手机号 /// 短信模板参数 /// - public static async Task SendAsync(this ISmsSender smsSender, string signName, string templateCode, string phoneNumber, IDictionary templateParams = null) + public static async Task SendAsync(this ISmsSender smsSender, string signName, string templateCode, string phoneNumber, IDictionary? templateParams = null) { var smsMessage = new SmsMessage(phoneNumber, nameof(AliyunSmsSender)); smsMessage.Properties.Add("SignName", signName); diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperOptions.cs index eb8c240c2..df2e68a07 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperOptions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperOptions.cs @@ -108,9 +108,9 @@ public class AbpWrapperOptions ExceptionHandles[exceptionType] = handler; } - public IExceptionWrapHandler GetHandler(Type exceptionType) + public IExceptionWrapHandler? GetHandler(Type exceptionType) { - ExceptionHandles.TryGetValue(exceptionType, out IExceptionWrapHandler handler); + ExceptionHandles.TryGetValue(exceptionType, out var handler); return handler; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/DefaultExceptionWrapHandler.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/DefaultExceptionWrapHandler.cs index 68bac8ab8..59a836d94 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/DefaultExceptionWrapHandler.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/DefaultExceptionWrapHandler.cs @@ -11,7 +11,7 @@ public class DefaultExceptionWrapHandler : IExceptionWrapHandler { if (context.Exception is IHasErrorCode exceptionWithErrorCode) { - string errorCode; + string? errorCode; if (!exceptionWithErrorCode.Code.IsNullOrWhiteSpace() && exceptionWithErrorCode.Code.Contains(":")) { @@ -22,7 +22,10 @@ public class DefaultExceptionWrapHandler : IExceptionWrapHandler errorCode = exceptionWithErrorCode.Code; } - context.WithCode(errorCode); + if (!errorCode.IsNullOrWhiteSpace()) + { + context.WithCode(errorCode); + } } // 没有处理的异常代码统一用配置代码处理 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/ExceptionWrapContext.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/ExceptionWrapContext.cs index 33bdd23b9..aa912ea6f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/ExceptionWrapContext.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/ExceptionWrapContext.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Net; using Volo.Abp.Http; @@ -42,6 +43,7 @@ namespace LINGYUN.Abp.Wrapper public ExceptionWrapContext WithData(string key, object value) { + ErrorInfo.Data ??= new Dictionary(); ErrorInfo.Data[key] = value; return this; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult.cs index 19b0cb537..f1cfe066e 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult.cs @@ -9,7 +9,7 @@ public class WrapResult: WrapResult public WrapResult( string code, string message, - string details = null) + string? details = null) : base(code, message, details) { } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult`T.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult`T.cs index 867c6c239..d925254d9 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult`T.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult`T.cs @@ -12,24 +12,24 @@ public class WrapResult /// /// 错误代码 /// - public string Code { get; set; } + public string Code { get; set; } = default!; /// /// 错误提示消息 /// - public string Message { get; set; } + public string Message { get; set; } = default!; /// /// 补充消息 /// - public string Details { get; set; } + public string? Details { get; set; } /// /// 返回值 /// - public TResult Result { get; set; } + public TResult? Result { get; set; } public WrapResult() { } public WrapResult( string code, string message, - string details = null) + string? details = null) { Code = code; Message = message; diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/System/TypeExtensions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/System/TypeExtensions.cs index a1a6d25a0..073588832 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/System/TypeExtensions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/System/TypeExtensions.cs @@ -11,7 +11,7 @@ internal static class TypeExtensions { public static bool IsActor(this Type actorType) { - Type baseType = actorType.GetTypeInfo().BaseType; + var baseType = actorType.GetTypeInfo().BaseType; while (baseType != null) { if (baseType == typeof(Actor)) @@ -35,7 +35,7 @@ internal static class TypeExtensions return list.ToArray(); } - public static RemoteServiceAttribute GetRemoteServiceAttribute(this Type type) + public static RemoteServiceAttribute? GetRemoteServiceAttribute(this Type type) { return type.GetInterfaces() .Where(t => t.IsDefined(typeof(RemoteServiceAttribute), false)) @@ -43,17 +43,17 @@ internal static class TypeExtensions .FirstOrDefault(); } - public static Type GetNonActorParentType(this Type type) + public static Type? GetNonActorParentType(this Type type) { - List list = new List(type.GetInterfaces()); + var list = new List(type.GetInterfaces()); if (list.RemoveAll((Type t) => t == typeof(IActor)) == 0) { return type; } - foreach (Type item in list) + foreach (var item in list) { - Type nonActorParentType = item.GetNonActorParentType(); + var nonActorParentType = item.GetNonActorParentType(); if (nonActorParentType != null) { return nonActorParentType; diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorCallException.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorCallException.cs index 9ed526e28..3196238db 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorCallException.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorCallException.cs @@ -7,11 +7,11 @@ namespace LINGYUN.Abp.Dapr.Actors; public class AbpDaprActorCallException : AbpException, IHasErrorCode, IHasErrorDetails { - public string Code => Error?.Code; + public string? Code => Error?.Code; - public string Details => Error?.Details; + public string? Details => Error?.Details; - public RemoteServiceErrorInfo Error { get; set; } + public RemoteServiceErrorInfo? Error { get; set; } public AbpDaprActorCallException() { diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DaprRemoteServiceConfigurationExtensions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DaprRemoteServiceConfigurationExtensions.cs index 5acf7110b..35823e57b 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DaprRemoteServiceConfigurationExtensions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DaprRemoteServiceConfigurationExtensions.cs @@ -11,7 +11,7 @@ public static class DaprRemoteServiceConfigurationExtensions public const string DaprApiToken = "DaprApiToken"; [CanBeNull] - public static string GetApiToken([NotNull] this RemoteServiceConfiguration configuration) + public static string? GetApiToken([NotNull] this RemoteServiceConfiguration configuration) { Check.NotNullOrEmpty(configuration, nameof(configuration)); diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DaprHttpClientHandler.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DaprHttpClientHandler.cs index 33ffa1372..7b0457b5c 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DaprHttpClientHandler.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DaprHttpClientHandler.cs @@ -8,8 +8,8 @@ namespace LINGYUN.Abp.Dapr.Actors.DynamicProxying; public class DaprHttpClientHandler : HttpClientHandler { - private Func _preConfigureInvoke; - protected Func PreConfigureInvoke => _preConfigureInvoke; + private Func? _preConfigureInvoke; + protected Func? PreConfigureInvoke => _preConfigureInvoke; public virtual void PreConfigure(Func config) { diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyInterceptor.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyInterceptor.cs index 06ef73a2a..63bd5ba32 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyInterceptor.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyInterceptor.cs @@ -141,7 +141,7 @@ public class DynamicDaprActorProxyInterceptor : AbpInterceptor, ITrans // 创建强类型代理 var actorProxy = proxyFactory.CreateActorProxy(actorId, actorType); // 远程调用 - var task = (Task)invocation.Method.Invoke(actorProxy, invocation.Arguments); + var task = (Task)invocation.Method.Invoke(actorProxy, invocation.Arguments)!; await task; // 存在返回值 @@ -150,8 +150,8 @@ public class DynamicDaprActorProxyInterceptor : AbpInterceptor, ITrans // 处理返回值 invocation.ReturnValue = typeof(Task<>) .MakeGenericType(invocation.Method.ReturnType.GenericTypeArguments[0]) - .GetProperty(nameof(Task.Result), BindingFlags.Public | BindingFlags.Instance) - .GetValue(task); + .GetProperty(nameof(Task.Result), BindingFlags.Public | BindingFlags.Instance)! + .GetValue(task)!; } } catch (ActorMethodInvocationException amie) // 其他异常忽略交给框架处理 diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN/Abp/Dapr/Client/Wrapper/AbpDaprClientWrapperModule.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN/Abp/Dapr/Client/Wrapper/AbpDaprClientWrapperModule.cs index 4db480468..4a3e02074 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN/Abp/Dapr/Client/Wrapper/AbpDaprClientWrapperModule.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN/Abp/Dapr/Client/Wrapper/AbpDaprClientWrapperModule.cs @@ -53,7 +53,7 @@ public class AbpDaprClientWrapperModule : AbpModule }; } - return jsonSerializer.Serialize(wrapResult.Result); + return jsonSerializer.Serialize(wrapResult.Result!); } return stringContent; diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/AbpDaprClientProxyOptions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/AbpDaprClientProxyOptions.cs index e1467f68a..54ba06b8e 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/AbpDaprClientProxyOptions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/AbpDaprClientProxyOptions.cs @@ -20,11 +20,11 @@ public class AbpDaprClientProxyOptions /// /// 对响应进行处理,返回响应内容 /// - public Func> ProxyResponseContent { get; private set; } + public Func>? ProxyResponseContent { get; private set; } /// /// 格式化错误 /// - public Func> ProxyErrorFormat { get; private set; } + public Func>? ProxyErrorFormat { get; private set; } public AbpDaprClientProxyOptions() { DaprClientProxies = new Dictionary(); @@ -39,7 +39,7 @@ public class AbpDaprClientProxyOptions /// 处理服务间调用响应数据 /// /// - public void OnResponse(Func> func) + public void OnResponse(Func> func) { ProxyResponseContent = func; } @@ -47,7 +47,7 @@ public class AbpDaprClientProxyOptions /// 处理服务间调用错误消息 /// /// - public void OnError(Func> func) + public void OnError(Func> func) { ProxyErrorFormat = func; } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/DaprClientProxyBase.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/DaprClientProxyBase.cs index 40d5e28b5..5c8a2eff0 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/DaprClientProxyBase.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/DaprClientProxyBase.cs @@ -38,24 +38,28 @@ public abstract class DaprClientProxyBase : ClientProxyBase responseContent.Headers?.ContentLength); } - var stringContent = await DaprClientProxyOptions - .Value - .ProxyResponseContent(response, LazyServiceProvider); - - if (stringContent.IsNullOrWhiteSpace()) + if (DaprClientProxyOptions.Value.ProxyResponseContent != null) { - return default; - } + var proxyStringContent = await DaprClientProxyOptions + .Value + .ProxyResponseContent(response, LazyServiceProvider); - if (typeof(T) == typeof(string)) - { - return (T)(object)stringContent; + if (proxyStringContent.IsNullOrWhiteSpace()) + { + return default!; + } + + if (typeof(T) == typeof(string)) + { + return (T)(object)proxyStringContent; + } } + var stringContent = await response.Content.ReadAsStringAsync(); return JsonSerializer.Deserialize(stringContent); } - protected async override Task GetConfiguredApiVersionAsync(ClientProxyRequestContext requestContext) + protected async override Task GetConfiguredApiVersionAsync(ClientProxyRequestContext requestContext) { var clientConfig = DaprClientProxyOptions.Value.DaprClientProxies.GetOrDefault(requestContext.ServiceType) ?? throw new AbpException($"Could not get DynamicDaprClientProxyConfig for {requestContext.ServiceType.FullName}."); diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprApiDescriptionFinder.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprApiDescriptionFinder.cs index e970d2027..1775f9ca6 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprApiDescriptionFinder.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprApiDescriptionFinder.cs @@ -119,7 +119,7 @@ public class DaprApiDescriptionFinder : IDaprApiDescriptionFinder, ITransientDep var result = JsonSerializer.Deserialize(content, DeserializeOptions); - return result; + return result!; } protected virtual void AddHeaders(HttpRequestMessage requestMessage) diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs index 900d01044..633d64f8c 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs @@ -64,7 +64,7 @@ public class DynamicDaprClientProxyInterceptor : AbpInterceptor, ITran var returnType = invocation.Method.ReturnType.GenericTypeArguments[0]; var result = (Task)CallRequestAsyncMethod .MakeGenericMethod(returnType) - .Invoke(this, new object[] { context }); + .Invoke(this, new object[] { context })!; invocation.ReturnValue = await GetResultAsync(result, returnType); } @@ -96,6 +96,6 @@ public class DynamicDaprClientProxyInterceptor : AbpInterceptor, ITran .MakeGenericType(resultType) .GetProperty(nameof(Task.Result), BindingFlags.Instance | BindingFlags.Public); Check.NotNull(resultProperty, nameof(resultProperty)); - return resultProperty.GetValue(task); + return resultProperty.GetValue(task)!; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientProxyExtensions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientProxyExtensions.cs index fefe07001..5a0339e46 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientProxyExtensions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientProxyExtensions.cs @@ -133,7 +133,7 @@ public static class ServiceCollectionDaprClientProxyExtensions return Activator.CreateInstance( typeof(DaprClientProxy<>).MakeGenericType(type), service - ); + )!; }); return services; diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/AsyncLocalCurrentDataAccessAccessor.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/AsyncLocalCurrentDataAccessAccessor.cs index 45e15a20b..ad69367c7 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/AsyncLocalCurrentDataAccessAccessor.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/AsyncLocalCurrentDataAccessAccessor.cs @@ -6,15 +6,15 @@ public class AsyncLocalCurrentDataAccessAccessor : ICurrentDataAccessAccessor { public static AsyncLocalCurrentDataAccessAccessor Instance { get; } = new(); - public DataAccessOperation[] Current + public DataAccessOperation[]? Current { get => _currentScope.Value; set => _currentScope.Value = value; } - private readonly AsyncLocal _currentScope; + private readonly AsyncLocal _currentScope; private AsyncLocalCurrentDataAccessAccessor() { - _currentScope = new AsyncLocal(); + _currentScope = new AsyncLocal(); } } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessEntityAuthCreateEvent.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessEntityAuthCreateEvent.cs index 0b2bc253b..93e094bd0 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessEntityAuthCreateEvent.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessEntityAuthCreateEvent.cs @@ -9,11 +9,11 @@ namespace LINGYUN.Abp.DataProtection; public class DataAccessEntityAuthCreateEvent : IMultiTenant { public Guid? TenantId { get; set; } - public string[] EntityKeys { get; set; } - public string EntityKeyType { get; set; } - public string EntityType { get; set; } - public string[] Roles { get; set; } - public string[] OrganizationUnits { get; set; } + public string[] EntityKeys { get; set; } = default!; + public string EntityKeyType { get; set; } = default!; + public string EntityType { get; set; } = default!; + public string[]? Roles { get; set; } + public string[]? OrganizationUnits { get; set; } public DataAccessEntityAuthCreateEvent() { @@ -22,8 +22,8 @@ public class DataAccessEntityAuthCreateEvent : IMultiTenant string entityType, string entityKeyType, string[] entityKeys, - string[] roles = null, - string[] organizationUnits = null, + string[]? roles = null, + string[]? organizationUnits = null, Guid? tenantId = null) { EntityType = entityType; diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessFilterRule.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessFilterRule.cs index eddbffc76..fa9b8eea3 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessFilterRule.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessFilterRule.cs @@ -8,19 +8,19 @@ public class DataAccessFilterRule /// /// 字段名称 /// - public string Field { get; set; } + public string Field { get; set; } = default!; /// /// 字段值 /// - public object Value { get; set; } + public object? Value { get; set; } /// /// 类型全名 /// - public string TypeFullName { get; set; } + public string TypeFullName { get; set; } = default!; /// /// Js类型 /// - public string JavaScriptType { get; set; } + public string JavaScriptType { get; set; } = default!; /// /// 操作类型 /// diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessResource.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessResource.cs index 5572b1c6d..731ed1388 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessResource.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessResource.cs @@ -9,17 +9,17 @@ public class DataAccessResource /// /// 权限主体 /// - public string SubjectName { get; set; } + public string SubjectName { get; set; } = default!; /// /// 权限主体标识 /// - public string SubjectId { get; set; } + public string SubjectId { get; set; } = default!; /// /// 实体类型全名 /// - public string EntityTypeFullName { get; set; } + public string EntityTypeFullName { get; set; } = default!; /// /// 数据权限操作 @@ -29,7 +29,7 @@ public class DataAccessResource /// /// 获取或设置 数据过滤规则 /// - public DataAccessFilterGroup FilterGroup { get; set; } + public DataAccessFilterGroup? FilterGroup { get; set; } /// /// 允许操作的属性列表 @@ -38,7 +38,7 @@ public class DataAccessResource public DataAccessResource() { - + AccessedProperties = new List(); } public DataAccessResource( @@ -46,7 +46,7 @@ public class DataAccessResource string subjectId, string entityTypeFullName, DataAccessOperation operation, - DataAccessFilterGroup filterGroup = null) + DataAccessFilterGroup? filterGroup = null) { SubjectName = subjectName; SubjectId = subjectId; diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessResourceChangeEvent.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessResourceChangeEvent.cs index aa23d1053..8d7f5264b 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessResourceChangeEvent.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessResourceChangeEvent.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Abp.DataProtection; public class DataAccessResourceChangeEvent { public bool IsEnabled { get; set; } - public DataAccessResource Resource { get; set; } + public DataAccessResource Resource { get; set; } = default!; public DataAccessResourceChangeEvent() { diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessScope.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessScope.cs index f08e63112..16825e10d 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessScope.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessScope.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.DataProtection; public class DataAccessScope : IDataAccessScope, ITransientDependency { - public DataAccessOperation[] Operations => _currentDataAccessAccessor.Current; + public DataAccessOperation[]? Operations => _currentDataAccessAccessor.Current; private readonly ICurrentDataAccessAccessor _currentDataAccessAccessor; public DataAccessScope(ICurrentDataAccessAccessor currentDataAccessAccessor) @@ -14,12 +14,12 @@ public class DataAccessScope : IDataAccessScope, ITransientDependency _currentDataAccessAccessor = currentDataAccessAccessor; } - public IDisposable BeginScope(DataAccessOperation[] operations = null) + public IDisposable BeginScope(DataAccessOperation[]? operations = null) { var parentScope = _currentDataAccessAccessor.Current; _currentDataAccessAccessor.Current = operations; - return new DisposeAction>(static (state) => + return new DisposeAction>(static (state) => { var (currentDataAccessAccessor, parentScope) = state; currentDataAccessAccessor.Current = parentScope; diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessStrategyState.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessStrategyState.cs index d822c9960..7140d32a1 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessStrategyState.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessStrategyState.cs @@ -8,12 +8,12 @@ public class DataAccessStrategyState /// /// 权限主体 /// - public string SubjectName { get; set; } + public string SubjectName { get; set; } = default!; /// /// 权限主体标识 /// - public string[] SubjectKeys { get; set; } + public string[] SubjectKeys { get; set; } = default!; /// /// 权限策略 diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/ICurrentDataAccessAccessor.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/ICurrentDataAccessAccessor.cs index 300afcd8a..f18b7e74f 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/ICurrentDataAccessAccessor.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/ICurrentDataAccessAccessor.cs @@ -2,5 +2,5 @@ public interface ICurrentDataAccessAccessor { - DataAccessOperation[] Current { get; set; } + DataAccessOperation[]? Current { get; set; } } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/IDataAccessScope.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/IDataAccessScope.cs index 354a2e34c..f5208f746 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/IDataAccessScope.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/IDataAccessScope.cs @@ -4,6 +4,6 @@ namespace LINGYUN.Abp.DataProtection; public interface IDataAccessScope { - DataAccessOperation[] Operations { get; } - IDisposable BeginScope(DataAccessOperation[] operations = null); + DataAccessOperation[]? Operations { get; } + IDisposable BeginScope(DataAccessOperation[]? operations = null); } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityEnumInfoModel.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityEnumInfoModel.cs index efd2e2bc7..0df4fe8a8 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityEnumInfoModel.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityEnumInfoModel.cs @@ -2,6 +2,15 @@ public class EntityEnumInfoModel { - public string Key { get; set; } - public object Value { get; set; } + public string Key { get; set; } = default!; + public object? Value { get; set; } + public EntityEnumInfoModel() + { + + } + public EntityEnumInfoModel(string key, object? value) + { + Key = key; + Value = value; + } } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityPropertyInfoModel.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityPropertyInfoModel.cs index 522338a16..3e5a041e6 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityPropertyInfoModel.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityPropertyInfoModel.cs @@ -5,29 +5,29 @@ public class EntityPropertyInfoModel /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 显示名称 /// - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; /// /// 类型全名 /// - public string TypeFullName { get; set; } + public string TypeFullName { get; set; } = default!; /// /// JavaScript类型 /// - public string JavaScriptType { get; set; } + public string JavaScriptType { get; set; } = default!; /// /// JavaScript名称 /// - public string JavaScriptName { get; set; } + public string JavaScriptName { get; set; } = default!; /// /// 枚举列表 /// - public EntityEnumInfoModel[] Enums { get; set; } + public EntityEnumInfoModel[]? Enums { get; set; } /// /// 允许的过滤操作列表 /// - public DataAccessFilterOperate[] Operates { get; set; } + public DataAccessFilterOperate[]? Operates { get; set; } } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityTypeInfoModel.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityTypeInfoModel.cs index 84d1f30c3..2b2c27653 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityTypeInfoModel.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Models/EntityTypeInfoModel.cs @@ -7,11 +7,11 @@ public class EntityTypeInfoModel /// /// 实体名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 显示名称 /// - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; /// /// 可访问属性列表 /// diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectedWriteEntityInterceptor.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectedWriteEntityInterceptor.cs index 03e0e1f48..81f4625d4 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectedWriteEntityInterceptor.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectedWriteEntityInterceptor.cs @@ -37,10 +37,10 @@ public class AbpDataProtectedWriteEntityInterceptor : SaveChangesInterceptor, IT if (!updateGrant.Succeeded) { var entityKeys = updateEntites - .Select(entity => (entity is IEntity abpEntity ? abpEntity.GetKeys() : new string[1] { entity.ToString() }).ToString()) + .Select(entity => (entity is IEntity abpEntity ? abpEntity.GetKeys() : new string[1] { entity!.ToString()! }).ToString()!) .JoinAsString(";"); throw new AbpDataAccessDeniedException( - $"Delete data permission not granted to entity {updateEntites.First().GetType()} for data {entityKeys}!"); + $"Delete data permission not granted to entity {updateEntites.First()!.GetType()} for data {entityKeys}!"); } } @@ -53,10 +53,10 @@ public class AbpDataProtectedWriteEntityInterceptor : SaveChangesInterceptor, IT if (!deleteGrant.Succeeded) { var entityKeys = deleteEntites - .Select(entity => (entity is IEntity abpEntity ? abpEntity.GetKeys() : new string[1] { entity.ToString() }).ToString()) + .Select(entity => (entity is IEntity abpEntity ? abpEntity.GetKeys() : new string[1] { entity!.ToString()! }).ToString()!) .JoinAsString(";"); throw new AbpDataAccessDeniedException( - $"Delete data permission not granted to entity {deleteEntites.First().GetType()} for data {entityKeys}!"); + $"Delete data permission not granted to entity {deleteEntites.First()!.GetType()} for data {entityKeys}!"); } } } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectedWritePropertiesInterceptor.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectedWritePropertiesInterceptor.cs index 5744d3ca4..2786632f2 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectedWritePropertiesInterceptor.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectedWritePropertiesInterceptor.cs @@ -29,7 +29,7 @@ public class AbpDataProtectedWritePropertiesInterceptor : SaveChangesInterceptor var allowProperties = new List(); var entity = entry.Entity; var entityType = entry.Entity.GetType(); - var subjectContext = new DataAccessSubjectContributorContext(entityType.FullName, DataAccessOperation.Write, LazyServiceProvider); + var subjectContext = new DataAccessSubjectContributorContext(entityType.FullName!, DataAccessOperation.Write, LazyServiceProvider); foreach (var contributor in DataProtectionOptions.Value.SubjectContributors) { var properties = await contributor.GetAccessdProperties(subjectContext); diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContextModelBuilderExtensions.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContextModelBuilderExtensions.cs index e2d172520..84fcc4d29 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContextModelBuilderExtensions.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContextModelBuilderExtensions.cs @@ -44,10 +44,12 @@ public static class AbpDataProtectionDbContextModelBuilderExtensions b.Property(p => p.Role) .HasColumnName(nameof(DataAuthBase.Role)) - .HasMaxLength(32); + .HasMaxLength(32) + .IsRequired(false); b.Property(p => p.OrganizationUnit) .HasColumnName(nameof(DataAuthBase.OrganizationUnit)) - .HasMaxLength(20); + .HasMaxLength(20) + .IsRequired(false); b.HasIndex(p => p.Role); b.HasIndex(p => p.OrganizationUnit); diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionModelBuilderConfigurationOptions.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionModelBuilderConfigurationOptions.cs index 54400dd7f..f2647c8c6 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionModelBuilderConfigurationOptions.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionModelBuilderConfigurationOptions.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.DataProtection.EntityFrameworkCore { public AbpDataProtectionModelBuilderConfigurationOptions( [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) + [CanBeNull] string? schema = null) : base( tablePrefix, schema) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/EfCoreDataAccessStrategyFilterBuilder.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/EfCoreDataAccessStrategyFilterBuilder.cs index 84a2fd422..2f819e9ad 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/EfCoreDataAccessStrategyFilterBuilder.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/EfCoreDataAccessStrategyFilterBuilder.cs @@ -17,7 +17,7 @@ public class EfCoreDataAccessStrategyFilterBuilder : DataAccessStrategyFilterBui = typeof(DbFunctionsExtensions) .GetMethod( nameof(DbFunctionsExtensions.Like), - new[] { typeof(DbFunctions), typeof(string), typeof(string) }); + new[] { typeof(DbFunctions), typeof(string), typeof(string) })!; private static readonly MethodInfo ContainsMethodInfo = typeof(Enumerable) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/EfCoreDataProtectionRepository.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/EfCoreDataProtectionRepository.cs index fc2217102..619339aa2 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/EfCoreDataProtectionRepository.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/EfCoreDataProtectionRepository.cs @@ -29,7 +29,7 @@ public abstract class EfCoreDataProtectionRepository LazyServiceProvider.GetRequiredService(); - protected IDataAccessStrategyFilterBuilder StrategyFilterBuilder => LazyServiceProvider.GetService(); + protected IDataAccessStrategyFilterBuilder? StrategyFilterBuilder => LazyServiceProvider.GetService(); protected EfCoreDataProtectionRepository( [NotNull] IDbContextProvider dbContextProvider, @@ -49,11 +49,20 @@ public abstract class EfCoreDataProtectionRepository(); var queryable = dbSet.AsQueryable().AsNoTrackingIf(!ShouldTrackingEntityChange()); - var strategyFilterResult = await StrategyFilterBuilder?.Build(queryable, dbContext.Set()); - if (strategyFilterResult != null && strategyFilterResult.Strategy != DataAccessStrategy.Custom) + if (StrategyFilterBuilder != null) { - // 根据配置的用户数据权限策略进行过滤 - queryable = strategyFilterResult.Queryable; + var strategyFilterResult = await StrategyFilterBuilder.Build(queryable, dbContext.Set()); + if (strategyFilterResult != null && strategyFilterResult.Strategy != DataAccessStrategy.Custom) + { + // 根据配置的用户数据权限策略进行过滤 + queryable = strategyFilterResult.Queryable; + } + else + { + // 根据配置的用户实体数据权限规则过滤 + var dataAccessFilterExp = await _entityTypeFilterBuilder.Build(DataAccessOperation.Read); + queryable = queryable.Where(dataAccessFilterExp); + } } else { @@ -174,10 +183,10 @@ public abstract class EfCoreDataProtectionRepository /// /// - protected virtual TEntityAuth CreateEntityRoleAuth(TEntity entity, string role) + protected virtual TEntityAuth? CreateEntityRoleAuth(TEntity entity, string role) { var entityAuth = Activator.CreateInstance(typeof(TEntityAuth), - new object[] { entity.Id, role, null, CurrentTenant.Id }); + new object?[] { entity.Id, role, null, CurrentTenant.Id }); return entityAuth as TEntityAuth; } @@ -187,10 +196,10 @@ public abstract class EfCoreDataProtectionRepository /// /// - protected virtual TEntityAuth CreateEntityOrganizationUnitAuth(TEntity entity, string ouCode) + protected virtual TEntityAuth? CreateEntityOrganizationUnitAuth(TEntity entity, string ouCode) { var entityAuth = Activator.CreateInstance(typeof(TEntityAuth), - new object[] { entity.Id, null, ouCode, CurrentTenant.Id }); + new object?[] { entity.Id, null, ouCode, CurrentTenant.Id }); return entityAuth as TEntityAuth; } @@ -211,7 +220,7 @@ public abstract class EfCoreDataProtectionRepository CreateEntityOrganizationUnitAuth(entity, ouCode)); - await entityAuth.AddRangeAsync(entityRoleAuths.Union(entityOuAuths), GetCancellationToken(cancellationToken)); + await entityAuth.AddRangeAsync(entityRoleAuths.Union(entityOuAuths)!, GetCancellationToken(cancellationToken)); } /// /// 持久化实体数据权限 @@ -234,7 +243,7 @@ public abstract class EfCoreDataProtectionRepository CreateEntityOrganizationUnitAuth(entity, ouCode)); - entityAuths.AddRange(entityRoleAuths.Union(entityOuAuths)); + entityAuths.AddRange(entityRoleAuths.Union(entityOuAuths)!); } await entityAuth.AddRangeAsync(entityAuths, GetCancellationToken(cancellationToken)); diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessEntityTypeInfoProvider.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessEntityTypeInfoProvider.cs index 7d283e80c..69a1e4aa9 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessEntityTypeInfoProvider.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessEntityTypeInfoProvider.cs @@ -29,7 +29,7 @@ public class DataAccessEntityTypeInfoProvider : IDataAccessEntityTypeInfoProvide }; var subjectContext = new DataAccessSubjectContributorContext( - context.EntityType.FullName, + context.EntityType.FullName!, context.Operation, context.ServiceProvider); @@ -63,7 +63,7 @@ public class DataAccessEntityTypeInfoProvider : IDataAccessEntityTypeInfoProvide var entityPropertyInfo = new EntityPropertyInfoModel { Name = propertyInfo.Name, - TypeFullName = propertyInfo.PropertyType.FullName, + TypeFullName = propertyInfo.PropertyType.FullName!, DisplayName = localizedProp.Value ?? propertyInfo.Name, JavaScriptType = propertyInfoResult.Type, JavaScriptName = propertyInfo.Name.ToCamelCase(), @@ -86,11 +86,9 @@ public class DataAccessEntityTypeInfoProvider : IDataAccessEntityTypeInfoProvide var enumName = enumNames[index]; var localizerEnumKey = $"{propertyInfo.Name}:{enumName}"; var localizerEnumName = stringLozalizer[localizerEnumKey]; - paramterOptions[index] = new EntityEnumInfoModel - { - Key = localizerEnumName.ResourceNotFound ? enumName : localizerEnumName.Value, - Value = enumValues.GetValue(index), - }; + paramterOptions[index] = new EntityEnumInfoModel( + localizerEnumName.ResourceNotFound ? enumName : localizerEnumName.Value, + enumValues.GetValue(index)); } entityPropertyInfo.Enums = paramterOptions; } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessStrategyFilterBuilderBase.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessStrategyFilterBuilderBase.cs index f7a667826..622d309dc 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessStrategyFilterBuilderBase.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessStrategyFilterBuilderBase.cs @@ -20,7 +20,9 @@ public abstract class DataAccessStrategyFilterBuilderBase : IDataAccessStrategyF _strategyStateProvider = strategyStateProvider; } - public async virtual Task> Build(IQueryable entity, IQueryable entityAuth) + public async virtual Task?> Build( + IQueryable entity, + IQueryable entityAuth) where TEntityAuth : DataAuthBase { if (ShouldApplyFilter(typeof(TEntity), DataAccessOperation.Read)) @@ -61,6 +63,9 @@ public abstract class DataAccessStrategyFilterBuilderBase : IDataAccessStrategyF return true; } - protected abstract IQueryable Build(IQueryable entity, IQueryable entityAuth, DataAccessStrategyState state) + protected abstract IQueryable Build( + IQueryable entity, + IQueryable entityAuth, + DataAccessStrategyState state) where TEntityAuth : DataAuthBase; } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessStrategyStateProvider.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessStrategyStateProvider.cs index ff2e48344..62f0448b5 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessStrategyStateProvider.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessStrategyStateProvider.cs @@ -17,7 +17,7 @@ public class DataAccessStrategyStateProvider : IDataAccessStrategyStateProvider, _serviceScopeFactory = serviceScopeFactory; } - public async virtual Task GetOrNullAsync() + public async virtual Task GetOrNullAsync() { using var scope = _serviceScopeFactory.CreateScope(); var context = new DataAccessStrategyContributorContext(scope.ServiceProvider); diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAuthBase.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAuthBase.cs index 0d56e52b9..f6d077062 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAuthBase.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAuthBase.cs @@ -7,11 +7,11 @@ namespace LINGYUN.Abp.DataProtection; public abstract class DataAuthBase : Entity, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - public virtual TKey EntityId { get; protected set; } - public virtual TEntity Entity { get; protected set; } - public virtual string EntityType { get; protected set; } - public virtual string Role { get; protected set; } - public virtual string OrganizationUnit { get; protected set; } + public virtual TKey EntityId { get; protected set; } = default!; + public virtual TEntity Entity { get; protected set; } = default!; + public virtual string EntityType { get; protected set; } = default!; + public virtual string? Role { get; protected set; } + public virtual string? OrganizationUnit { get; protected set; } protected DataAuthBase() { @@ -28,6 +28,6 @@ public abstract class DataAuthBase : Entity, IMultiTenant Role = role; OrganizationUnit = organizationUnit; - EntityType = typeof(TEntity).FullName; + EntityType = typeof(TEntity).FullName!; } } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAuthorizationService.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAuthorizationService.cs index 15e9723c7..3f83e4b7e 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAuthorizationService.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAuthorizationService.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Authorization; using System.Collections.Generic; using System.Linq; -using System.Reflection; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; @@ -9,7 +8,6 @@ namespace LINGYUN.Abp.DataProtection; public class DataAuthorizationService : IDataAuthorizationService, ITransientDependency { - private readonly static MethodInfo AllMethod = typeof(Enumerable).GetMethod(nameof(Enumerable.All), BindingFlags.Public | BindingFlags.Static); private readonly IEntityTypeFilterBuilder _entityTypeFilterBuilder; public DataAuthorizationService(IEntityTypeFilterBuilder entityTypeFilterBuilder) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/EntityPropertyResultBuilder.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/EntityPropertyResultBuilder.cs index 614650ca3..951cad484 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/EntityPropertyResultBuilder.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/EntityPropertyResultBuilder.cs @@ -38,9 +38,8 @@ public class EntityPropertyResultBuilder : IEntityPropertyResultBuilder, ITransi return selector; } - var typeName = entityType.FullName; var allowProperties = new List(); - var subjectContext = new DataAccessSubjectContributorContext(typeName, operation, _serviceProvider); + var subjectContext = new DataAccessSubjectContributorContext(entityType.FullName!, operation, _serviceProvider); foreach (var contributor in _options.SubjectContributors) { var properties = await contributor.GetAccessdProperties(subjectContext); @@ -86,9 +85,8 @@ public class EntityPropertyResultBuilder : IEntityPropertyResultBuilder, ITransi return selector; } - var typeName = typeof(TEntity).FullName; var allowProperties = new List(); - var subjectContext = new DataAccessSubjectContributorContext(typeName, operation, _serviceProvider); + var subjectContext = new DataAccessSubjectContributorContext(typeof(TEntity).FullName!, operation, _serviceProvider); foreach (var contributor in _options.SubjectContributors) { var properties = await contributor.GetAccessdProperties(subjectContext); diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/EntityTypeFilterBuilder.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/EntityTypeFilterBuilder.cs index 0429ebf1c..105dd03d8 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/EntityTypeFilterBuilder.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/EntityTypeFilterBuilder.cs @@ -33,7 +33,7 @@ public class EntityTypeFilterBuilder : IEntityTypeFilterBuilder, ITransientDepen _serviceProvider = serviceProvider; } - public async virtual Task Build(Type entityType, DataAccessOperation operation, DataAccessFilterGroup group = null) + public async virtual Task Build(Type entityType, DataAccessOperation operation, DataAccessFilterGroup? group = null) { // Func var func = typeof(Func<,>).MakeGenericType(entityType, typeof(bool)); @@ -54,16 +54,15 @@ public class EntityTypeFilterBuilder : IEntityTypeFilterBuilder, ITransientDepen exp = GetExpression(entityType, group); } - var typeName = entityType.FullName; var subjectFilterGroups = new List(); - var subjectContext = new DataAccessSubjectContributorContext(typeName, operation, _serviceProvider); + var subjectContext = new DataAccessSubjectContributorContext(entityType.FullName!, operation, _serviceProvider); foreach (var contributor in _options.SubjectContributors) { var subjectFilterGroup = await contributor.GetFilterGroups(subjectContext); subjectFilterGroups.AddRange(subjectFilterGroup); } - LambdaExpression subExp = null; + LambdaExpression? subExp = null; if (subjectFilterGroups.Count == 0 && _options.DefaultEntityFilters.TryGetValue(entityType, out var filterFunc)) @@ -90,7 +89,7 @@ public class EntityTypeFilterBuilder : IEntityTypeFilterBuilder, ITransientDepen return exp; } - public async virtual Task>> Build(DataAccessOperation operation, DataAccessFilterGroup group = null) + public async virtual Task>> Build(DataAccessOperation operation, DataAccessFilterGroup? group = null) { var entityType = typeof(TEntity); Expression> exp = _ => true; @@ -105,16 +104,15 @@ public class EntityTypeFilterBuilder : IEntityTypeFilterBuilder, ITransientDepen exp = GetExpression(group); } - var typeName = typeof(TEntity).FullName; var subjectFilterGroups = new List(); - var subjectContext = new DataAccessSubjectContributorContext(typeName, operation, _serviceProvider); + var subjectContext = new DataAccessSubjectContributorContext(typeof(TEntity).FullName!, operation, _serviceProvider); foreach (var contributor in _options.SubjectContributors) { var subjectFilterGroup = await contributor.GetFilterGroups(subjectContext); subjectFilterGroups.AddRange(subjectFilterGroup); } - Expression> subExp = null; + Expression>? subExp = null; foreach ( var subGroup in subjectFilterGroups) { subExp = subExp == null ? GetExpression(subGroup) : subExp.Or(GetExpression(subGroup)); @@ -218,7 +216,7 @@ public class EntityTypeFilterBuilder : IEntityTypeFilterBuilder, ITransientDepen return rule.IsLeft ? operateContributor.BuildExpression(constant, expression.Body) : operateContributor.BuildExpression(expression.Body, constant); } - private static LambdaExpression GetPropertyLambdaExpression(ParameterExpression param, DataAccessFilterRule rule) + private static LambdaExpression? GetPropertyLambdaExpression(ParameterExpression param, DataAccessFilterRule rule) { var propertyNames = rule.Field.Split('.'); Expression propertyAccess = param; @@ -273,7 +271,7 @@ public class EntityTypeFilterBuilder : IEntityTypeFilterBuilder, ITransientDepen return Expression.Constant(valueArray, arrayType); } - var valueType = rule.Value.GetType(); + var valueType = rule.Value!.GetType(); if (valueType.IsArrayOrListType()) { diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyContributor.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyContributor.cs index 6561518e8..a2b126c67 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyContributor.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyContributor.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.DataProtection; public interface IDataAccessStrategyContributor { string Name { get; } - Task GetOrNullAsync(DataAccessStrategyContributorContext context); + Task GetOrNullAsync(DataAccessStrategyContributorContext context); } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyFilterBuilder.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyFilterBuilder.cs index eaa49fc6a..b084808c8 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyFilterBuilder.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyFilterBuilder.cs @@ -8,6 +8,8 @@ namespace LINGYUN.Abp.DataProtection; /// public interface IDataAccessStrategyFilterBuilder { - Task> Build(IQueryable entity, IQueryable entityAuth) + Task?> Build( + IQueryable entity, + IQueryable entityAuth) where TEntityAuth : DataAuthBase; } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyStateProvider.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyStateProvider.cs index 3568d1a0a..aaf7b60b1 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyStateProvider.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessStrategyStateProvider.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.DataProtection; public interface IDataAccessStrategyStateProvider { - Task GetOrNullAsync(); + Task GetOrNullAsync(); } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAuthorizationServiceExtensions.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAuthorizationServiceExtensions.cs index 365969624..dc9c53f3b 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAuthorizationServiceExtensions.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAuthorizationServiceExtensions.cs @@ -11,7 +11,7 @@ public static class IDataAuthorizationServiceExtensions var result = await dataAuthorizationService.AuthorizeAsync(operation, entities); if (!result.Succeeded) { - var entityKeys = entities.Select(x => x.ToString()).JoinAsString(";"); + var entityKeys = entities.Select(x => x!.ToString()!).JoinAsString(";"); throw new AbpDataAccessDeniedException( $"The {operation} operation with entity type {typeof(Entity)} identified as {entityKeys} is not allowed!"); } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IEntityTypeFilterBuilder.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IEntityTypeFilterBuilder.cs index 897554635..7a828ab85 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IEntityTypeFilterBuilder.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IEntityTypeFilterBuilder.cs @@ -15,7 +15,7 @@ public interface IEntityTypeFilterBuilder /// 查询条件组 /// 实体类型 /// - Task>> Build(DataAccessOperation operation, DataAccessFilterGroup group = null); + Task>> Build(DataAccessOperation operation, DataAccessFilterGroup? group = null); - Task Build(Type entityType, DataAccessOperation operation, DataAccessFilterGroup group = null); + Task Build(Type entityType, DataAccessOperation operation, DataAccessFilterGroup? group = null); } \ No newline at end of file diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/JavaScriptTypeConvert.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/JavaScriptTypeConvert.cs index f95b44fbf..3b385b35e 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/JavaScriptTypeConvert.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/JavaScriptTypeConvert.cs @@ -20,7 +20,7 @@ public class JavaScriptTypeConvert : IJavaScriptTypeConvert, ISingletonDependenc var availableComparator = new List(); if (propertyType.IsNullableType()) { - propertyType = propertyType.GetGenericArguments().FirstOrDefault(); + propertyType = propertyType.GetGenericArguments().First(); } if (typeof(Enum).IsAssignableFrom(propertyType)) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Keywords/DataAccessCurrentUserContributor.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Keywords/DataAccessCurrentUserContributor.cs index 507a7ef23..2c7196daa 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Keywords/DataAccessCurrentUserContributor.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Keywords/DataAccessCurrentUserContributor.cs @@ -20,18 +20,19 @@ public class DataAccessCurrentUserContributor : IDataAccessKeywordContributor var conversionType = context.Expression.Body.Type; var currentUser = context.ServiceProvider.GetRequiredService(); + // TODO: Guid? == Guid? var userId = CastTo(currentUser.Id, conversionType); // entity.Where(x => x.CreatorId == CurrentUser.Id); return Expression.Constant(userId, conversionType); } - private static object CastTo(object value, Type conversionType) + private static object CastTo(object? value, Type conversionType) { if (conversionType == typeof(Guid) || conversionType == typeof(Guid?)) { - return TypeDescriptor.GetConverter(conversionType).ConvertFromInvariantString(value.ToString()!)!; + return TypeDescriptor.GetConverter(conversionType).ConvertFromInvariantString(value?.ToString()!)!; } - return Convert.ChangeType(value, conversionType, CultureInfo.InvariantCulture); + return Convert.ChangeType(value!, conversionType, CultureInfo.InvariantCulture); } } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataAccessStrategyStateCacheItem.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataAccessStrategyStateCacheItem.cs index 0d97bde0c..d4491c089 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataAccessStrategyStateCacheItem.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataAccessStrategyStateCacheItem.cs @@ -11,12 +11,12 @@ public class DataAccessStrategyStateCacheItem /// /// 权限主体 /// - public string SubjectName { get; set; } + public string SubjectName { get; set; } = default!; /// /// 权限主体标识 /// - public string SubjectId { get; set; } + public string SubjectId { get; set; } = default!; /// /// 权限策略 diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceCache.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceCache.cs index b5a160d97..1e7f2c62d 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceCache.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceCache.cs @@ -13,14 +13,14 @@ public class DataProtectedResourceCache : IDataProtectedResourceCache, ITransien _cache = cache; } - public virtual DataProtectedResourceCacheItem GetCache(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation) + public virtual DataProtectedResourceCacheItem? GetCache(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation) { var cacheKey = DataProtectedResourceCacheItem.CalculateCacheKey(subjectName, subjectId, entityTypeFullName, operation); var cacheItem = _cache.Get(cacheKey); return cacheItem; } - public async virtual Task GetCacheAsync(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation) + public async virtual Task GetCacheAsync(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation) { var cacheKey = DataProtectedResourceCacheItem.CalculateCacheKey(subjectName, subjectId, entityTypeFullName, operation); var cacheItem = await _cache.GetAsync(cacheKey); diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceCacheItem.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceCacheItem.cs index 6a8f20fa8..5bbf01000 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceCacheItem.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceCacheItem.cs @@ -12,17 +12,17 @@ public class DataProtectedResourceCacheItem /// /// 权限主体 /// - public string SubjectName { get; set; } + public string SubjectName { get; set; } = default!; /// /// 权限主体标识 /// - public string SubjectId { get; set; } + public string SubjectId { get; set; } = default!; /// /// 实体类型全名 /// - public string EntityTypeFullName { get; set; } + public string EntityTypeFullName { get; set; } = default!; /// /// 数据权限操作 @@ -32,7 +32,7 @@ public class DataProtectedResourceCacheItem /// /// 获取或设置 数据过滤规则 /// - public DataAccessFilterGroup FilterGroup { get; set; } + public DataAccessFilterGroup? FilterGroup { get; set; } /// /// 允许操作的属性列表 @@ -40,7 +40,7 @@ public class DataProtectedResourceCacheItem public List AccessdProperties { get; set; } public DataProtectedResourceCacheItem() { - + AccessdProperties = new List(); } public DataProtectedResourceCacheItem( @@ -48,7 +48,7 @@ public class DataProtectedResourceCacheItem string subjectId, string entityTypeFullName, DataAccessOperation operation, - DataAccessFilterGroup filterGroup = null) + DataAccessFilterGroup? filterGroup = null) { SubjectName = subjectName; SubjectId = subjectId; diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceStore.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceStore.cs index 56d776961..5f77ec677 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceStore.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedResourceStore.cs @@ -12,7 +12,7 @@ public class DataProtectedResourceStore : IDataProtectedResourceStore, ITransien _cache = cache; } - public virtual DataAccessResource Get(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation) + public virtual DataAccessResource? Get(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation) { var cacheItem = _cache.GetCache(subjectName, subjectId, entityTypeFullName, operation); if (cacheItem == null) @@ -30,7 +30,7 @@ public class DataProtectedResourceStore : IDataProtectedResourceStore, ITransien }; } - public async virtual Task GetAsync(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation) + public async virtual Task GetAsync(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation) { var cacheItem = await _cache.GetCacheAsync(subjectName, subjectId, entityTypeFullName, operation); if (cacheItem == null) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedStrategyStateCache.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedStrategyStateCache.cs index dc34b2f1c..a463ebf8c 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedStrategyStateCache.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedStrategyStateCache.cs @@ -14,7 +14,7 @@ public class DataProtectedStrategyStateCache : IDataProtectedStrategyStateCache, _cache = cache; } - public async virtual Task GetAsync(string subjectName, string subjectId) + public async virtual Task GetAsync(string subjectName, string subjectId) { var cacheKey = DataAccessStrategyStateCacheItem.CalculateCacheKey(subjectName, subjectId); var cacheItem = await _cache.GetAsync(cacheKey); diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedStrategyStateStore.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedStrategyStateStore.cs index ade9b168e..ce720935d 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedStrategyStateStore.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/DataProtectedStrategyStateStore.cs @@ -12,7 +12,7 @@ public class DataProtectedStrategyStateStore : IDataProtectedStrategyStateStore, _cache = cache; } - public async virtual Task GetOrNullAsync(string subjectName, string subjectId) + public async virtual Task GetOrNullAsync(string subjectName, string subjectId) { var cacheItem = await _cache.GetAsync(subjectName, subjectId); if (cacheItem == null ) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedResourceCache.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedResourceCache.cs index 8257bb54f..894939733 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedResourceCache.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedResourceCache.cs @@ -31,7 +31,7 @@ public interface IDataProtectedResourceCache /// 实体类型名称 /// 数据权限操作 /// 数据过滤条件组 - DataProtectedResourceCacheItem GetCache(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation); + DataProtectedResourceCacheItem? GetCache(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation); /// /// 获取指定主体与实体类型的数据权限过滤规则 /// @@ -40,5 +40,5 @@ public interface IDataProtectedResourceCache /// 实体类型名称 /// 数据权限操作 /// 数据过滤条件组 - Task GetCacheAsync(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation); + Task GetCacheAsync(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation); } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedResourceStore.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedResourceStore.cs index 0de7bbd87..32de4a5ae 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedResourceStore.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedResourceStore.cs @@ -7,5 +7,5 @@ public interface IDataProtectedResourceStore Task RemoveAsync(DataAccessResource resource); - Task GetAsync(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation); + Task GetAsync(string subjectName, string subjectId, string entityTypeFullName, DataAccessOperation operation); } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedStrategyStateCache.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedStrategyStateCache.cs index af3db1321..ce4aacd08 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedStrategyStateCache.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedStrategyStateCache.cs @@ -8,5 +8,5 @@ public interface IDataProtectedStrategyStateCache Task RemoveAsync(DataAccessStrategyState state); - Task GetAsync(string subjectName, string subjectId); + Task GetAsync(string subjectName, string subjectId); } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedStrategyStateStore.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedStrategyStateStore.cs index bcdec11fb..d5d810615 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedStrategyStateStore.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Stores/IDataProtectedStrategyStateStore.cs @@ -8,5 +8,5 @@ public interface IDataProtectedStrategyStateStore Task RemoveAsync(DataAccessStrategyState state); - Task GetOrNullAsync(string subjectName, string subjectId); + Task GetOrNullAsync(string subjectName, string subjectId); } diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessClientIdContributor.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessClientIdContributor.cs index 632878484..c5121549b 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessClientIdContributor.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessClientIdContributor.cs @@ -18,7 +18,7 @@ public class DataAccessClientIdContributor : IDataAccessSubjectContributor if (currentClient.IsAuthenticated) { var resourceStore = context.ServiceProvider.GetRequiredService(); - var resource = await resourceStore.GetAsync(Name, currentClient.Id, context.EntityTypeFullName, context.Operation); + var resource = await resourceStore.GetAsync(Name, currentClient.Id!, context.EntityTypeFullName, context.Operation); if (resource?.AccessedProperties.Any() == true) { allowProperties.AddIfNotContains(resource.AccessedProperties); @@ -34,7 +34,7 @@ public class DataAccessClientIdContributor : IDataAccessSubjectContributor if (currentClient.IsAuthenticated) { var resourceStore = context.ServiceProvider.GetRequiredService(); - var resource = await resourceStore.GetAsync(Name, currentClient.Id, context.EntityTypeFullName, context.Operation); + var resource = await resourceStore.GetAsync(Name, currentClient.Id!, context.EntityTypeFullName, context.Operation); if (resource?.FilterGroup != null) { groups.Add(resource.FilterGroup); diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessStrategyRoleNameContributor.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessStrategyRoleNameContributor.cs index 2f479b7de..9df5ce798 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessStrategyRoleNameContributor.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessStrategyRoleNameContributor.cs @@ -15,7 +15,7 @@ public class DataAccessStrategyRoleNameContributor : IDataAccessStrategyContribu { public string Name => RolePermissionValueProvider.ProviderName; - public async virtual Task GetOrNullAsync(DataAccessStrategyContributorContext context) + public async virtual Task GetOrNullAsync(DataAccessStrategyContributorContext context) { var states = new List(); var currentUser = context.ServiceProvider.GetRequiredService(); diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessUserIdContributor.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessUserIdContributor.cs index 48e4986b4..0f9276467 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessUserIdContributor.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessUserIdContributor.cs @@ -19,7 +19,7 @@ public class DataAccessUserIdContributor : IDataAccessSubjectContributor if (currentUser.IsAuthenticated) { var resourceStore = context.ServiceProvider.GetRequiredService(); - var resource = await resourceStore.GetAsync(Name, currentUser.Id.ToString(), context.EntityTypeFullName, context.Operation); + var resource = await resourceStore.GetAsync(Name, currentUser.Id.ToString()!, context.EntityTypeFullName, context.Operation); if (resource?.FilterGroup != null) { groups.Add(resource.FilterGroup); @@ -35,7 +35,7 @@ public class DataAccessUserIdContributor : IDataAccessSubjectContributor if (currentUser.IsAuthenticated) { var resourceStore = context.ServiceProvider.GetRequiredService(); - var resource = await resourceStore.GetAsync(Name, currentUser.Id.ToString(), context.EntityTypeFullName, context.Operation); + var resource = await resourceStore.GetAsync(Name, currentUser.Id.ToString()!, context.EntityTypeFullName, context.Operation); if (resource?.AccessedProperties.Any() == true) { allowProperties.AddIfNotContains(resource.AccessedProperties); diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/DynamicParamterDto.cs b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/DynamicParamterDto.cs index 57fe27bfd..0083e770d 100644 --- a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/DynamicParamterDto.cs +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/DynamicParamterDto.cs @@ -4,10 +4,10 @@ namespace LINGYUN.Abp.Dynamic.Queryable; public class DynamicParamterDto { - public string Name { get; set; } - public string Description { get; set; } - public string Type { get; set; } - public string JavaScriptType { get; set; } + public string Name { get; set; } = default!; + public string Description { get; set; } = default!; + public string Type { get; set; } = default!; + public string JavaScriptType { get; set; } = default!; public DynamicComparison[] AvailableComparator { get; set; } public ParamterOptionDto[] Options { get; set; } public DynamicParamterDto() diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/GetListByDynamicQueryableInput.cs b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/GetListByDynamicQueryableInput.cs index 2f27a81f6..319409105 100644 --- a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/GetListByDynamicQueryableInput.cs +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/GetListByDynamicQueryableInput.cs @@ -7,5 +7,5 @@ namespace LINGYUN.Abp.Dynamic.Queryable; public class GetListByDynamicQueryableInput : PagedAndSortedResultRequestDto { [Required] - public DynamicQueryable Queryable { get; set; } + public DynamicQueryable Queryable { get; set; } = default!; } diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/ParamterOptionDto.cs b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/ParamterOptionDto.cs index 8120e099e..623fff071 100644 --- a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/ParamterOptionDto.cs +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN/Abp/Dynamic/Queryable/Dto/ParamterOptionDto.cs @@ -1,6 +1,6 @@ namespace LINGYUN.Abp.Dynamic.Queryable; public class ParamterOptionDto { - public string Key { get; set; } - public object Value { get; set; } + public string Key { get; set; } = default!; + public object? Value { get; set; } } diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/LINGYUN/Linq/Dynamic/Queryable/DynamicParamter.cs b/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/LINGYUN/Linq/Dynamic/Queryable/DynamicParamter.cs index 0d0f38edc..6a47434d6 100644 --- a/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/LINGYUN/Linq/Dynamic/Queryable/DynamicParamter.cs +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/LINGYUN/Linq/Dynamic/Queryable/DynamicParamter.cs @@ -7,13 +7,13 @@ public class DynamicParamter { [NotNull] [Required] - public string Field { get; set; } + public string Field { get; set; } = default!; public DynamicLogic Logic { get; set; } = DynamicLogic.And; public DynamicComparison Comparison { get; set; } = DynamicComparison.Equal; - public object Value { get; set; } + public object? Value { get; set; } - public string Type { get; set; } + public string? Type { get; set; } } diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/System/Linq/Expressions/ObjectQueryableExtensions.cs b/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/System/Linq/Expressions/ObjectQueryableExtensions.cs index b31c2bf9e..38cdce1e8 100644 --- a/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/System/Linq/Expressions/ObjectQueryableExtensions.cs +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/System/Linq/Expressions/ObjectQueryableExtensions.cs @@ -11,7 +11,7 @@ public static class ObjectQueryableExtensions this Expression condition, DynamicQueryable queryable) { - var typeExpression = condition.Parameters.FirstOrDefault(); + var typeExpression = condition.Parameters.First(); return BuildExpressions(condition, typeExpression, queryable.Paramters); } @@ -24,16 +24,16 @@ public static class ObjectQueryableExtensions var expressions = new Stack(); foreach (var paramter in paramters) { - Expression exp = null; - Type propertyType = null; + Expression? exp = null; + Type propertyType; var leftParamter = Expression.PropertyOrField(typeExpression, paramter.Field); if (!string.IsNullOrWhiteSpace(paramter.Type)) { - propertyType = Type.GetType(paramter.Type, true); + propertyType = Type.GetType(paramter.Type, true)!; } else { - propertyType = (leftParamter.Member as PropertyInfo)?.PropertyType ?? paramter.Value.GetType(); + propertyType = (leftParamter.Member as PropertyInfo)?.PropertyType ?? paramter.Value!.GetType(); } switch (paramter.Comparison) { @@ -71,7 +71,7 @@ public static class ObjectQueryableExtensions // ...Other And Field LIKE 'Value%' exp = Expression.Call( leftParamter, - typeof(string).GetMethod(nameof(String.StartsWith), new[] { typeof(string) }), + typeof(string).GetMethod(nameof(String.StartsWith), new[] { typeof(string) })!, GetValue(paramter, propertyType)); // TODO: 单元测试通过 @@ -97,7 +97,7 @@ public static class ObjectQueryableExtensions exp = Expression.Not( Expression.Call( leftParamter, - typeof(string).GetMethod(nameof(String.StartsWith), new[] { typeof(string) }), + typeof(string).GetMethod(nameof(String.StartsWith), new[] { typeof(string) })!, GetValue(paramter, propertyType))); // TODO: 单元测试通过 @@ -120,7 +120,7 @@ public static class ObjectQueryableExtensions // ...Other AND Field LIKE '%Value' exp = Expression.Call( leftParamter, - typeof(string).GetMethod(nameof(String.EndsWith), new[] { typeof(string) }), + typeof(string).GetMethod(nameof(String.EndsWith), new[] { typeof(string) })!, GetValue(paramter, propertyType)); // TODO: 单元测试通过 @@ -144,7 +144,7 @@ public static class ObjectQueryableExtensions exp = Expression.Not( Expression.Call( leftParamter, - typeof(string).GetMethod(nameof(String.EndsWith), new[] { typeof(string) }), + typeof(string).GetMethod(nameof(String.EndsWith), new[] { typeof(string) })!, GetValue(paramter, propertyType))); // TODO: 单元测试通过 @@ -167,7 +167,7 @@ public static class ObjectQueryableExtensions // ...Other AND (Field LIKE '%Value%') exp = Expression.Call( leftParamter, - typeof(string).GetMethod(nameof(String.Contains), new[] { typeof(string) }), + typeof(string).GetMethod(nameof(String.Contains), new[] { typeof(string) })!, GetValue(paramter, propertyType)); // TODO: 单元测试通过 @@ -191,7 +191,7 @@ public static class ObjectQueryableExtensions exp = Expression.Not( Expression.Call( leftParamter, - typeof(string).GetMethod(nameof(String.Contains), new[] { typeof(string) }), + typeof(string).GetMethod(nameof(String.Contains), new[] { typeof(string) })!, GetValue(paramter, propertyType))); // TODO: 单元测试通过 // For example(MySql): @@ -265,14 +265,14 @@ public static class ObjectQueryableExtensions return Expression.LessThan( Expression.Call( member, - typeof(string).GetMethod("CompareTo", new[] { typeof(string) }), + typeof(string).GetMethod("CompareTo", new[] { typeof(string) })!, Expression.Constant(Convert.ToString(paramter.Value))), Expression.Constant(0)); } if (propertyType.IsNullableType()) { // 可空类型比较: Field < Value - var underlyingType = Nullable.GetUnderlyingType(propertyType); + var underlyingType = Nullable.GetUnderlyingType(propertyType)!; var hasValue = Expression.Property(member, "HasValue"); var value = Expression.Property(member, "Value"); @@ -300,14 +300,14 @@ public static class ObjectQueryableExtensions return Expression.LessThanOrEqual( Expression.Call( member, - typeof(string).GetMethod("CompareTo", new[] { typeof(string) }), + typeof(string).GetMethod("CompareTo", new[] { typeof(string) })!, Expression.Constant(Convert.ToString(paramter.Value))), Expression.Constant(0)); } if (propertyType.IsNullableType()) { // 可空类型比较: Field <= Value - var underlyingType = Nullable.GetUnderlyingType(propertyType); + var underlyingType = Nullable.GetUnderlyingType(propertyType)!; var hasValue = Expression.Property(member, "HasValue"); var value = Expression.Property(member, "Value"); @@ -335,14 +335,14 @@ public static class ObjectQueryableExtensions return Expression.GreaterThan( Expression.Call( member, - typeof(string).GetMethod("CompareTo", new[] { typeof(string) }), + typeof(string).GetMethod("CompareTo", new[] { typeof(string) })!, Expression.Constant(Convert.ToString(paramter.Value))), Expression.Constant(0)); } if (propertyType.IsNullableType()) { // 可空类型比较: Field > Value - var underlyingType = Nullable.GetUnderlyingType(propertyType); + var underlyingType = Nullable.GetUnderlyingType(propertyType)!; var hasValue = Expression.Property(member, "HasValue"); var value = Expression.Property(member, "Value"); @@ -370,7 +370,7 @@ public static class ObjectQueryableExtensions return Expression.GreaterThanOrEqual( Expression.Call( member, - typeof(string).GetMethod("CompareTo", new[] { typeof(string) }), + typeof(string).GetMethod("CompareTo", new[] { typeof(string) })!, Expression.Constant(Convert.ToString(paramter.Value))), Expression.Constant(0)); } @@ -378,7 +378,7 @@ public static class ObjectQueryableExtensions if (propertyType.IsNullableType()) { // 可空类型比较: Field >= Value - var underlyingType = Nullable.GetUnderlyingType(propertyType); + var underlyingType = Nullable.GetUnderlyingType(propertyType)!; var hasValue = Expression.Property(member, "HasValue"); var value = Expression.Property(member, "Value"); @@ -403,15 +403,15 @@ public static class ObjectQueryableExtensions object typedValue; if (propertyType.IsNullableType()) { - propertyType = Nullable.GetUnderlyingType(propertyType); + propertyType = Nullable.GetUnderlyingType(propertyType)!; } - typedValue = Convert.ChangeType(paramter.Value, propertyType); + typedValue = Convert.ChangeType(paramter.Value, propertyType)!; return Expression.Constant(typedValue, propertyType); } - private static object GetDefaultValue(Type type) + private static object? GetDefaultValue(Type type) { // TODO: 非空字段此处返回默认值 if (type.IsNullableType()) diff --git a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs index 03c421f20..e1cb6d5e6 100644 --- a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs +++ b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs @@ -21,7 +21,9 @@ namespace LINGYUN.Abp.Elasticsearch /// Defaults to false. /// public bool DisableDirectStreaming { get; set; } - public string NodeUris { get; set; } + + public string NodeUris { get; set; } = default!; + public int ConnectionLimit { get; set; } /// /// `Base64ApiKey` for Elastic Cloud style encoded api keys @@ -43,11 +45,10 @@ namespace LINGYUN.Abp.Elasticsearch /// Default: 60s /// public TimeSpan RequestTimeout { get; set; } - /// - /// - /// - public IRequestInvoker RequestInvoker { get; set; } - public SourceSerializerFactory SerializerFactory { get; set; } + + public IRequestInvoker RequestInvoker { get; set; } = default!; + + public SourceSerializerFactory SerializerFactory { get; set; } = default!; public AbpElasticsearchOptions() { @@ -55,6 +56,7 @@ namespace LINGYUN.Abp.Elasticsearch // Default: 60s // See: https://www.elastic.co/docs/reference/elasticsearch/clients/dotnet/_options_on_elasticsearchclientsettings RequestTimeout = TimeSpan.FromSeconds(60); + RequestInvoker = new HttpRequestInvoker(); } internal IElasticsearchClientSettings CreateClientSettings() diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityChangeDto.cs b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityChangeDto.cs index a5a29c20c..074a71b92 100644 --- a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityChangeDto.cs +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityChangeDto.cs @@ -13,9 +13,9 @@ public class EntityChangeDto : ExtensibleEntityDto public Guid? EntityTenantId { get; set; } - public string EntityId { get; set; } + public string EntityId { get; set; } = default!; - public string EntityTypeFullName { get; set; } + public string EntityTypeFullName { get; set; } = default!; public List PropertyChanges { get; set; } diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityChangeGetListInput.cs b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityChangeGetListInput.cs index ee9d9b5e5..3ee3b7220 100644 --- a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityChangeGetListInput.cs +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityChangeGetListInput.cs @@ -10,5 +10,5 @@ public class EntityChangeGetListInput : PagedAndSortedResultRequestDto public DateTime? StartTime { get; set; } public DateTime? EndTime { get; set; } public EntityChangeType? ChangeType { get; set; } - public string EntityId { get; set; } + public string? EntityId { get; set; } } diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityPropertyChangeDto.cs b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityPropertyChangeDto.cs index df56f8407..6297fde5c 100644 --- a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityPropertyChangeDto.cs +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/EntityPropertyChangeDto.cs @@ -5,11 +5,11 @@ namespace LINGYUN.Abp.EntityChange; public class EntityPropertyChangeDto : EntityDto { - public string NewValue { get; set; } + public string? NewValue { get; set; } - public string OriginalValue { get; set; } + 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!; } diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/RestoreEntitiesInput.cs b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/RestoreEntitiesInput.cs index c9e1fd84d..a2c80ae2b 100644 --- a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/RestoreEntitiesInput.cs +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/RestoreEntitiesInput.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.EntityChange; public class RestoreEntitiesInput { [Required] - public List Entities { get; set; } + public List Entities { get; set; } = default!; } diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/RestoreEntityInput.cs b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/RestoreEntityInput.cs index cb33d5b34..ca3fe45b7 100644 --- a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/RestoreEntityInput.cs +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN/Abp/EntityChange/RestoreEntityInput.cs @@ -9,7 +9,7 @@ public class RestoreEntityInput /// 实体标识 /// [Required] - public string EntityId { get; set; } + public string EntityId { get; set; } = default!; /// /// 还原到某个版本标识 /// diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN/Abp/EntityChange/EntityChangeAppService.cs b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN/Abp/EntityChange/EntityChangeAppService.cs index fa6037fd1..bbc57a7a4 100644 --- a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN/Abp/EntityChange/EntityChangeAppService.cs +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN/Abp/EntityChange/EntityChangeAppService.cs @@ -11,7 +11,7 @@ namespace LINGYUN.Abp.EntityChange; public abstract class EntityChangeAppService : ApplicationService, IEntityChangeAppService where TEntity : class { - protected virtual string GetListPolicy { get; set; } + protected virtual string? GetListPolicy { get; set; } protected IEntityChangeStore EntityChangeStore { get; } diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN/Abp/EntityChange/EntityRestoreAppService.cs b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN/Abp/EntityChange/EntityRestoreAppService.cs index 4c55cd2b0..1d488d151 100644 --- a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN/Abp/EntityChange/EntityRestoreAppService.cs +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN/Abp/EntityChange/EntityRestoreAppService.cs @@ -14,7 +14,7 @@ namespace LINGYUN.Abp.EntityChange; public abstract class EntityRestoreAppService : EntityChangeAppService, IEntityRestoreAppService where TEntity : class, IEntity { - protected virtual string RestorePolicy { get; set; } + protected virtual string? RestorePolicy { get; set; } protected IRepository Repository { get; } @@ -40,7 +40,7 @@ public abstract class EntityRestoreAppService : EntityChangeAppSe await RestoreEntityByAuditLogAsync(restoreEntity); } - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task RestoreEntityAsync(RestoreEntityInput input) @@ -52,7 +52,7 @@ public abstract class EntityRestoreAppService : EntityChangeAppSe await RestoreEntityByAuditLogAsync(input); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } protected virtual TKey MapToEntityKey(string entityId) diff --git a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/ClientFeatureManagementProvider.cs b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/ClientFeatureManagementProvider.cs index cad41f55a..a99f057f4 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/ClientFeatureManagementProvider.cs +++ b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/ClientFeatureManagementProvider.cs @@ -1,4 +1,5 @@ using LINGYUN.Abp.Features.Client; +using System; using System.Threading.Tasks; using Volo.Abp.Clients; using Volo.Abp.DependencyInjection; @@ -24,7 +25,7 @@ public class ClientFeatureManagementProvider : FeatureManagementProvider, ITrans protected override Task NormalizeProviderKeyAsync(string providerKey) { - if (providerKey != null) + if (CurrentClient.Id.IsNullOrWhiteSpace() || providerKey != null) { return base.NormalizeProviderKeyAsync(providerKey); } diff --git a/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/ClientFeatureValueProvider.cs b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/ClientFeatureValueProvider.cs index bb53bb0fc..548ca7333 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/ClientFeatureValueProvider.cs +++ b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/ClientFeatureValueProvider.cs @@ -20,7 +20,7 @@ public class ClientFeatureValueProvider : FeatureValueProvider CurrentClient = currentClient; } - public override async Task GetOrNullAsync(FeatureDefinition feature) + public async override Task GetOrNullAsync(FeatureDefinition feature) { if (!CurrentClient.IsAuthenticated) { diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetLanguageWithFilterDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetLanguageWithFilterDto.cs index c26f460ff..a10cd9e64 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetLanguageWithFilterDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetLanguageWithFilterDto.cs @@ -2,5 +2,5 @@ public class GetLanguageWithFilterDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetResourceWithFilterDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetResourceWithFilterDto.cs index bf2134dad..44a1b8aec 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetResourceWithFilterDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetResourceWithFilterDto.cs @@ -2,5 +2,5 @@ public class GetResourceWithFilterDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextByKeyInput.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextByKeyInput.cs index 8a08370cf..0c0c9f940 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextByKeyInput.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextByKeyInput.cs @@ -1,16 +1,15 @@ using System.ComponentModel.DataAnnotations; -using Volo.Abp.Validation; namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; public class GetTextByKeyInput { [Required] - public string Key { get; set; } + public string Key { get; set; } = default!; [Required] - public string CultureName { get; set; } + public string CultureName { get; set; } = default!; [Required] - public string ResourceName { get; set; } + public string ResourceName { get; set; } = default!; } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextsInput.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextsInput.cs index e1536930f..521272d19 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextsInput.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextsInput.cs @@ -5,14 +5,14 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; public class GetTextsInput { [Required] - public string CultureName { get; set; } + public string CultureName { get; set; } = default!; [Required] - public string TargetCultureName { get; set; } + public string TargetCultureName { get; set; } = default!; - public string ResourceName { get; set; } + public string? ResourceName { get; set; } public bool? OnlyNull { get; set; } - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageAppService.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageAppService.cs index 7c7b34a07..8c34e4b88 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageAppService.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageAppService.cs @@ -22,9 +22,9 @@ public class LanguageAppService : ApplicationService, ILanguageAppService public async virtual Task> GetListAsync(GetLanguageWithFilterDto input) { var languages = (await _languageProvider.GetLanguagesAsync()) - .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.CultureName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0 - || x.UiCultureName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0 - || x.DisplayName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0); + .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.CultureName.IndexOf(input.Filter!, StringComparison.OrdinalIgnoreCase) >= 0 + || x.UiCultureName.IndexOf(input.Filter!, StringComparison.OrdinalIgnoreCase) >= 0 + || x.DisplayName.IndexOf(input.Filter!, StringComparison.OrdinalIgnoreCase) >= 0); return new ListResultDto( languages.Select(l => new LanguageDto diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageDto.cs index 024d9d1c4..9eb8f7515 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageDto.cs @@ -2,9 +2,9 @@ { public class LanguageDto { - public string CultureName { get; set; } - public string UiCultureName { get; set; } - public string DisplayName { get; set; } - public string TwoLetterISOLanguageName { get; set; } + public string CultureName { get; set; } = default!; + public string UiCultureName { get; set; } = default!; + public string DisplayName { get; set; } = default!; + public string TwoLetterISOLanguageName { get; set; } = default!; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceAppService.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceAppService.cs index ac8d6db76..72c7192d8 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceAppService.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceAppService.cs @@ -29,11 +29,11 @@ public class ResourceAppService : ApplicationService, IResourceAppService public virtual async Task> GetListAsync(GetResourceWithFilterDto input) { var externalResources = (await _externalLocalizationStore.GetResourcesAsync()) - .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter, StringComparison.OrdinalIgnoreCase)); + .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter!, StringComparison.OrdinalIgnoreCase)); var resources = _localizationOptions .Resources - .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.Value.ResourceName.Contains(input.Filter, StringComparison.OrdinalIgnoreCase)) + .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.Value.ResourceName.Contains(input.Filter!, StringComparison.OrdinalIgnoreCase)) .Select(x => new ResourceDto { Name = x.Value.ResourceName, diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceDto.cs index 8fe5dc568..985e0906e 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceDto.cs @@ -2,7 +2,7 @@ public class ResourceDto { - public string Name { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } + public string Name { get; set; } = default!; + public string DisplayName { get; set; } = default!; + public string? Description { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextAppService.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextAppService.cs index 754915b66..096f6864c 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextAppService.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextAppService.cs @@ -56,7 +56,7 @@ public class TextAppService : ApplicationService, ITextAppService .Select(r => r.Value) .Union(await _externalLocalizationStore.GetResourcesAsync()) .DistinctBy(r => r.ResourceName) - .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter)) + .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter!)) .OrderBy(r => r.ResourceName); foreach (var resource in filterResources) @@ -72,7 +72,7 @@ public class TextAppService : ApplicationService, ITextAppService .Union(await _externalLocalizationStore.GetResourcesAsync()) .DistinctBy(r => r.ResourceName) .Where(l => l.ResourceName.Equals(input.ResourceName)) - .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter)) + .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter!)) .FirstOrDefault(); if (resource != null) { @@ -88,7 +88,7 @@ public class TextAppService : ApplicationService, ITextAppService LocalizationResourceBase resource, string cultureName, string targetCultureName, - string filter = null, + string? filter = null, bool? onlyNull = null) { var result = new List(); @@ -100,7 +100,7 @@ public class TextAppService : ApplicationService, ITextAppService using (CultureHelper.Use(cultureName, cultureName)) { localizedStrings = (await localizer.GetAllStringsAsync(true, false, true)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter!)) .OrderBy(l => l.Name); } @@ -113,7 +113,7 @@ public class TextAppService : ApplicationService, ITextAppService using (CultureHelper.Use(targetCultureName, targetCultureName)) { targetLocalizedStrings = (await localizer.GetAllStringsAsync(false, false, true)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter!)) .OrderBy(l => l.Name); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDifferenceDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDifferenceDto.cs index 19e983319..b90c59f20 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDifferenceDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDifferenceDto.cs @@ -2,12 +2,12 @@ public class TextDifferenceDto { - public string CultureName { get; set; } - public string Key { get; set; } - public string Value { get; set; } - public string ResourceName { get; set; } - public string TargetCultureName { get; set; } - public string TargetValue { get; set; } + public string CultureName { get; set; } = default!; + public string Key { get; set; } = default!; + public string? Value { get; set; } + public string ResourceName { get; set; } = default!; + public string TargetCultureName { get; set; } = default!; + public string? TargetValue { get; set; } public int CompareTo(TextDifferenceDto other) { diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDto.cs index 110793d38..096062f63 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDto.cs @@ -2,8 +2,8 @@ public class TextDto { - public string Key { get; set; } - public string Value { get; set; } - public string CultureName { get; set; } - public string ResourceName { get; set; } + public string Key { get; set; } = default!; + public string? Value { get; set; } + public string CultureName { get; set; } = default!; + public string? ResourceName { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpCultureMapRequestCultureProvider.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpCultureMapRequestCultureProvider.cs index 8b3cae4a9..2089429fb 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpCultureMapRequestCultureProvider.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpCultureMapRequestCultureProvider.cs @@ -13,7 +13,7 @@ namespace LINGYUN.Abp.Localization.CultureMap; public class AbpCultureMapRequestCultureProvider : RequestCultureProvider { - public override async Task DetermineProviderCultureResult(HttpContext httpContext) + public override async Task DetermineProviderCultureResult(HttpContext httpContext) { if (httpContext == null) { diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/CultureMapInfo.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/CultureMapInfo.cs index d4c493e03..06f4a7d6e 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/CultureMapInfo.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/CultureMapInfo.cs @@ -2,7 +2,7 @@ public class CultureMapInfo { - public string TargetCulture { get; set; } + public string? TargetCulture { get; set; } - public string[] SourceCultures { get; set; } + public string[] SourceCultures { get; set; } = default!; } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/Microsoft/AspNetCore/Builder/AbpCultureMapApplicationBuilderExtensions.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/Microsoft/AspNetCore/Builder/AbpCultureMapApplicationBuilderExtensions.cs index a26e0ee22..dc14a1157 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/Microsoft/AspNetCore/Builder/AbpCultureMapApplicationBuilderExtensions.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/Microsoft/AspNetCore/Builder/AbpCultureMapApplicationBuilderExtensions.cs @@ -7,7 +7,7 @@ public static class AbpCultureMapApplicationBuilderExtensions { public static IApplicationBuilder UseMapRequestLocalization( this IApplicationBuilder app, - Action optionsAction = null) + Action? optionsAction = null) { return app.UseAbpRequestLocalization(options => { diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlFileLocalizationResourceContributorBase.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlFileLocalizationResourceContributorBase.cs index cceb81851..25c952f27 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlFileLocalizationResourceContributorBase.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlFileLocalizationResourceContributorBase.cs @@ -14,8 +14,8 @@ public abstract class XmlFileLocalizationResourceContributorBase : ILocalization { private readonly string _filePath; - private IFileProvider _fileProvider; - private Dictionary _dictionaries; + private IFileProvider _fileProvider = default!; + private Dictionary? _dictionaries; private bool _subscribedForChanges; private readonly object _syncObj = new object(); @@ -33,7 +33,7 @@ public abstract class XmlFileLocalizationResourceContributorBase : ILocalization Check.NotNull(_fileProvider, nameof(_fileProvider)); } - public virtual LocalizedString GetOrNull(string cultureName, string name) + public virtual LocalizedString? GetOrNull(string cultureName, string name) { return GetDictionaries().GetOrDefault(cultureName)?.GetOrNull(name); } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationDictionaryBuilder.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationDictionaryBuilder.cs index 4ce17d66f..25b01bfa0 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationDictionaryBuilder.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationDictionaryBuilder.cs @@ -27,10 +27,10 @@ public static class XmlLocalizationDictionaryBuilder XmlLocalizationFile xmlFile; try { - XmlSerializer serializer = new XmlSerializer(typeof(XmlLocalizationFile)); - using (StringReader reader = new StringReader(xmlString)) + var serializer = new XmlSerializer(typeof(XmlLocalizationFile)); + using (var reader = new StringReader(xmlString)) { - xmlFile = (XmlLocalizationFile)serializer.Deserialize(reader); + xmlFile = (XmlLocalizationFile)serializer.Deserialize(reader)!; } } catch (Exception ex) diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs index 8e7178289..06d34ecb5 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs @@ -63,7 +63,7 @@ public class XmlLocalizationFile public class CultureInfo { [XmlAttribute("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; public CultureInfo() { @@ -79,10 +79,10 @@ public class CultureInfo public class LocalizationText { [XmlAttribute("key")] - public string Key { get; set; } + public string Key { get; set; } = default!; [XmlAttribute("value")] - public string Value { get; set; } + public string Value { get; set; } = default!; public LocalizationText() { diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchMappers.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchMappers.cs index 4ddde949a..77e98f2e9 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchMappers.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchMappers.cs @@ -25,7 +25,7 @@ public partial class SerilogFieldToLogFieldMapper : MapperBase时间类型或者转换为timestamp都可以查询 /// /// - public async virtual Task GetAsync( + public async virtual Task GetAsync( string id, CancellationToken cancellationToken = default) { @@ -129,20 +129,20 @@ public class SerilogElasticsearchLoggingManager : ILoggingManager, ISingletonDep cancellationToken); } - return _objectMapper.Map(response.Documents.FirstOrDefault()); + return _objectMapper.Map(response.Documents.FirstOrDefault()); } public async virtual Task GetCountAsync( DateTime? startTime = null, DateTime? endTime = null, LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, + string? machineName = null, + string? environment = null, + string? application = null, + string? context = null, + string? requestId = null, + string? requestPath = null, + string? correlationId = null, int? processId = null, int? threadId = null, bool? hasException = null, @@ -196,19 +196,19 @@ public class SerilogElasticsearchLoggingManager : ILoggingManager, ISingletonDep /// /// public async virtual Task> GetListAsync( - string sorting = null, + string? sorting = null, int maxResultCount = 50, int skipCount = 0, DateTime? startTime = null, DateTime? endTime = null, LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, + string? machineName = null, + string? environment = null, + string? application = null, + string? context = null, + string? requestId = null, + string? requestPath = null, + string? correlationId = null, int? processId = null, int? threadId = null, bool? hasException = null, @@ -256,13 +256,13 @@ public class SerilogElasticsearchLoggingManager : ILoggingManager, ISingletonDep DateTime? startTime = null, DateTime? endTime = null, LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, + string? machineName = null, + string? environment = null, + string? application = null, + string? context = null, + string? requestId = null, + string? requestPath = null, + string? correlationId = null, int? processId = null, int? threadId = null, bool? hasException = null) diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogException.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogException.cs index f1748ca4b..45dffddee 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogException.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogException.cs @@ -8,20 +8,20 @@ public class SerilogException public int Depth { get; set; } [JsonPropertyName("ClassName")] - public string Class { get; set; } + public string? Class { get; set; } [JsonPropertyName("Message")] - public string Message { get; set; } + public string? Message { get; set; } [JsonPropertyName("Source")] - public string Source { get; set; } + public string? Source { get; set; } [JsonPropertyName("StackTraceString")] - public string StackTrace { get; set; } + public string? StackTrace { get; set; } [JsonPropertyName("HResult")] public int HResult { get; set; } [JsonPropertyName("HelpURL")] - public string HelpURL { get; set; } + public string? HelpURL { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs index 345a30ebb..e140ac458 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs @@ -8,50 +8,50 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch; public class SerilogField { [JsonPropertyName(AbpSerilogUniqueIdConsts.UniqueIdPropertyName)] - public long UniqueId { get; set; } + public long? UniqueId { get; set; } [JsonPropertyName(AbpLoggingEnricherPropertyNames.MachineName)] - public string MachineName { get; set; } + public string? MachineName { get; set; } [JsonPropertyName(AbpLoggingEnricherPropertyNames.EnvironmentName)] - public string Environment { get; set; } + public string? Environment { get; set; } [JsonPropertyName(AbpSerilogEnrichersConsts.ApplicationNamePropertyName)] - public string Application { get; set; } + public string? Application { get; set; } [JsonPropertyName("SourceContext")] - public string Context { get; set; } + public string? Context { get; set; } [JsonPropertyName("ActionId")] - public string ActionId { get; set; } + public string? ActionId { get; set; } [JsonPropertyName("ActionName")] - public string ActionName { get; set; } + public string? ActionName { get; set; } [JsonPropertyName("RequestId")] - public string RequestId { get; set; } + public string? RequestId { get; set; } [JsonPropertyName("RequestPath")] - public string RequestPath { get; set; } + public string? RequestPath { get; set; } [JsonPropertyName("ConnectionId")] - public string ConnectionId { get; set; } + public string? ConnectionId { get; set; } [JsonPropertyName("CorrelationId")] - public string CorrelationId { get; set; } + public string? CorrelationId { get; set; } [JsonPropertyName("ClientId")] - public string ClientId { get; set; } + public string? ClientId { get; set; } [JsonPropertyName("UserId")] - public string UserId { get; set; } + public string? UserId { get; set; } [JsonPropertyName("TenantId")] public Guid? TenantId { get; set; } [JsonPropertyName("ProcessId")] - public int ProcessId { get; set; } + public int? ProcessId { get; set; } [JsonPropertyName("ThreadId")] - public int ThreadId { get; set; } + public int? ThreadId { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogInfo.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogInfo.cs index 4b9908489..b5cdadaa6 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogInfo.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogInfo.cs @@ -16,11 +16,11 @@ public class SerilogInfo public LogEventLevel Level { get; set; } [JsonPropertyName(ElasticsearchJsonFormatter.RenderedMessagePropertyName)] - public string Message { get; set; } + public string? Message { get; set; } [JsonPropertyName("fields")] - public SerilogField Fields { get; set; } + public SerilogField Fields { get; set; } = default!; [JsonPropertyName("exceptions")] - public List Exceptions { get; set; } + public List? Exceptions { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/DefaultLoggingManager.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/DefaultLoggingManager.cs index b21772d68..fc1725cff 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/DefaultLoggingManager.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/DefaultLoggingManager.cs @@ -18,10 +18,10 @@ public class DefaultLoggingManager : ILoggingManager, ISingletonDependency Logger = NullLogger.Instance; } - public Task GetAsync(string id, CancellationToken cancellationToken = default) + public Task GetAsync(string id, CancellationToken cancellationToken = default) { Logger.LogDebug("No logging manager is available!"); - LogInfo logInfo = null; + LogInfo? logInfo = null; return Task.FromResult(logInfo); } @@ -29,13 +29,13 @@ public class DefaultLoggingManager : ILoggingManager, ISingletonDependency DateTime? startTime = null, DateTime? endTime = null, LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, + string? machineName = null, + string? environment = null, + string? application = null, + string? context = null, + string? requestId = null, + string? requestPath = null, + string? correlationId = null, int? processId = null, int? threadId = null, bool? hasException = null, @@ -46,19 +46,19 @@ public class DefaultLoggingManager : ILoggingManager, ISingletonDependency } public Task> GetListAsync( - string sorting = null, + string? sorting = null, int maxResultCount = 50, int skipCount = 0, DateTime? startTime = null, DateTime? endTime = null, LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, + string? machineName = null, + string? environment = null, + string? application = null, + string? context = null, + string? requestId = null, + string? requestPath = null, + string? correlationId = null, int? processId = null, int? threadId = null, bool? hasException = null, diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/ILoggingManager.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/ILoggingManager.cs index 8f38b1ba8..aa0e37ee6 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/ILoggingManager.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/ILoggingManager.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Abp.Logging; public interface ILoggingManager { - Task GetAsync( + Task GetAsync( string id, CancellationToken cancellationToken = default); @@ -16,32 +16,32 @@ public interface ILoggingManager DateTime? startTime = null, DateTime? endTime = null, LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, + string? machineName = null, + string? environment = null, + string? application = null, + string? context = null, + string? requestId = null, + string? requestPath = null, + string? correlationId = null, int? processId = null, int? threadId = null, bool? hasException = null, CancellationToken cancellationToken = default); Task> GetListAsync( - string sorting = null, + string? sorting = null, int maxResultCount = 50, int skipCount = 0, DateTime? startTime = null, DateTime? endTime = null, LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, + string? machineName = null, + string? environment = null, + string? application = null, + string? context = null, + string? requestId = null, + string? requestPath = null, + string? correlationId = null, int? processId = null, int? threadId = null, bool? hasException = null, diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogException.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogException.cs index 69de9768f..666b2d8c8 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogException.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogException.cs @@ -3,10 +3,10 @@ public class LogException { public int Depth { get; set; } - public string Class { get; set; } - public string Message { get; set; } - public string Source { get; set; } - public string StackTrace { get; set; } + public string? Class { get; set; } + public string? Message { get; set; } + public string? Source { get; set; } + public string? StackTrace { get; set; } public int HResult { get; set; } - public string HelpURL { get; set; } + public string? HelpURL { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogField.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogField.cs index d1469cfd0..494884d03 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogField.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogField.cs @@ -2,19 +2,19 @@ public class LogField { - public string Id { get; set; } - public string MachineName { get; set; } - public string Environment { get; set; } - public string Application { get; set; } - public string Context { get; set; } - public string ActionId { get; set; } - public string ActionName { get; set; } - public string RequestId { get; set; } - public string RequestPath { get; set; } - public string ConnectionId { get; set; } - public string CorrelationId { get; set; } - public string ClientId { get; set; } - public string UserId { get; set; } - public int ProcessId { get; set; } - public int ThreadId { get; set; } + public string? Id { get; set; } + public string? MachineName { get; set; } + public string? Environment { get; set; } + public string? Application { get; set; } + public string? Context { get; set; } + public string? ActionId { get; set; } + public string? ActionName { get; set; } + public string? RequestId { get; set; } + public string? RequestPath { get; set; } + public string? ConnectionId { get; set; } + public string? CorrelationId { get; set; } + public string? ClientId { get; set; } + public string? UserId { get; set; } + public int? ProcessId { get; set; } + public int? ThreadId { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogInfo.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogInfo.cs index 36e767590..e285d6d8e 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogInfo.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogInfo.cs @@ -8,7 +8,7 @@ public class LogInfo { public DateTime TimeStamp { get; set; } public LogLevel Level { get; set; } - public string Message { get; set; } - public LogField Fields { get; set; } - public List Exceptions { get; set; } + public string? Message { get; set; } + public LogField Fields { get; set; } = default!; + public List? Exceptions { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/ApplicationNameEnricher.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/ApplicationNameEnricher.cs index 9be8cb26f..1371161db 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/ApplicationNameEnricher.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/ApplicationNameEnricher.cs @@ -5,7 +5,7 @@ namespace LINGYUN.Abp.Serilog.Enrichers.Application; public class ApplicationNameEnricher : ILogEventEnricher { - LogEventProperty _cachedProperty; + LogEventProperty? _cachedProperty; public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) { logEvent.AddPropertyIfAbsent(GetLogEventProperty(propertyFactory)); diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/UniqueIdEnricher.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/UniqueIdEnricher.cs index cc71471ac..82548df7f 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/UniqueIdEnricher.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/UniqueIdEnricher.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.Serilog.Enrichers.UniqueId; public class UniqueIdEnricher : ILogEventEnricher { - internal static IDistributedIdGenerator DistributedIdGenerator; + internal static IDistributedIdGenerator DistributedIdGenerator = default!; public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) { diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Idempotent/Wrapper/AbpWrapIdempotentActionFilter.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Idempotent/Wrapper/AbpWrapIdempotentActionFilter.cs index 762b77945..eef40a63d 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Idempotent/Wrapper/AbpWrapIdempotentActionFilter.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Idempotent/Wrapper/AbpWrapIdempotentActionFilter.cs @@ -28,13 +28,13 @@ public class AbpWrapIdempotentActionFilter : AbpIdempotentActionFilter, ITransie var exceptionHandlingOptions = context.ExecutingContext.GetRequiredService>().Value; var errorInfo = new RemoteServiceErrorResponse( - errorInfoConverter.Convert(context.GrantResult.Exception, options => + errorInfoConverter.Convert(context.GrantResult.Exception!, options => { options.SendExceptionsDetailsToClients = exceptionHandlingOptions.SendExceptionsDetailsToClients; options.SendStackTraceToClients = exceptionHandlingOptions.SendStackTraceToClients; }) ); - var result = new WrapResult(errorInfo.Error.Code, errorInfo.Error.Message, errorInfo.Error.Details); + var result = new WrapResult(errorInfo.Error.Code!, errorInfo.Error.Message!, errorInfo.Error.Details); context.ExecutingContext.Result = new JsonResult(result) { StatusCode = context.IdempotentOptions.HttpStatusCode, diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent/LINGYUN/Abp/AspNetCore/Mvc/Idempotent/AbpIdempotentActionFilter.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent/LINGYUN/Abp/AspNetCore/Mvc/Idempotent/AbpIdempotentActionFilter.cs index 7c4c06902..f07ce8531 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent/LINGYUN/Abp/AspNetCore/Mvc/Idempotent/AbpIdempotentActionFilter.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent/LINGYUN/Abp/AspNetCore/Mvc/Idempotent/AbpIdempotentActionFilter.cs @@ -93,7 +93,7 @@ public class AbpIdempotentActionFilter : IAsyncActionFilter, ITransientDependenc var exceptionHandlingOptions = context.ExecutingContext.GetRequiredService>().Value; var errorInfo = new RemoteServiceErrorResponse( - errorInfoConverter.Convert(context.GrantResult.Exception, options => + errorInfoConverter.Convert(context.GrantResult.Exception!, options => { options.SendExceptionsDetailsToClients = exceptionHandlingOptions.SendExceptionsDetailsToClients; options.SendStackTraceToClients = exceptionHandlingOptions.SendStackTraceToClients; diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ApiExploring/AbpWrapResultApiDescriptionProvider.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ApiExploring/AbpWrapResultApiDescriptionProvider.cs index 25b88ff96..81655dacf 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ApiExploring/AbpWrapResultApiDescriptionProvider.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ApiExploring/AbpWrapResultApiDescriptionProvider.cs @@ -66,7 +66,7 @@ public class AbpWrapResultApiDescriptionProvider : IApiDescriptionProvider, ITra { var returnType = AsyncHelper.UnwrapTask(actionDescriptor.MethodInfo.ReturnType); - Type wrapResultType = null; + Type? wrapResultType = null; if (returnType == null || returnType == typeof(void)) { wrapResultType = typeof(WrapResult); diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs index b23e2323a..85e961ec4 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs @@ -37,24 +37,24 @@ public class AbpExceptionPageWrapResultFilter: AbpExceptionPageFilter, ITransien var wrapOptions = context.GetRequiredService>().Value; var exceptionHandlingOptions = context.GetRequiredService>().Value; var exceptionToErrorInfoConverter = context.GetRequiredService(); - var remoteServiceErrorInfo = exceptionToErrorInfoConverter.Convert(context.Exception, options => + var remoteServiceErrorInfo = exceptionToErrorInfoConverter.Convert(context.Exception!, options => { options.SendExceptionsDetailsToClients = exceptionHandlingOptions.SendExceptionsDetailsToClients; options.SendStackTraceToClients = exceptionHandlingOptions.SendStackTraceToClients; }); - var logLevel = context.Exception.GetLogLevel(); + var logLevel = context.Exception!.GetLogLevel(); var remoteServiceErrorInfoBuilder = new StringBuilder(); remoteServiceErrorInfoBuilder.AppendLine($"---------- {nameof(RemoteServiceErrorInfo)} ----------"); remoteServiceErrorInfoBuilder.AppendLine(context.GetRequiredService().Serialize(remoteServiceErrorInfo, indented: true)); var logger = context.GetService>(NullLogger.Instance); - logger.LogWithLevel(logLevel, remoteServiceErrorInfoBuilder.ToString()); + logger?.LogWithLevel(logLevel, remoteServiceErrorInfoBuilder.ToString()); - logger.LogException(context.Exception, logLevel); + logger?.LogException(context.Exception!, logLevel); - await context.GetRequiredService().NotifyAsync(new ExceptionNotificationContext(context.Exception)); + await context.GetRequiredService().NotifyAsync(new ExceptionNotificationContext(context.Exception!)); var isAuthenticated = context.HttpContext.User?.Identity?.IsAuthenticated ?? false; @@ -85,10 +85,10 @@ public class AbpExceptionPageWrapResultFilter: AbpExceptionPageFilter, ITransien var statusCodFinder = context.GetRequiredService(); var exceptionWrapHandler = context.GetRequiredService(); var exceptionWrapContext = new ExceptionWrapContext( - context.Exception, + context.Exception!, remoteServiceErrorInfo, context.HttpContext.RequestServices, - statusCodFinder.GetStatusCode(context.HttpContext, context.Exception)); + statusCodFinder.GetStatusCode(context.HttpContext, context.Exception!)); exceptionWrapHandler.CreateFor(exceptionWrapContext).Wrap(exceptionWrapContext); var wrapperHeaders = new Dictionary() @@ -103,8 +103,8 @@ public class AbpExceptionPageWrapResultFilter: AbpExceptionPageFilter, ITransien httpResponseWrapper.Wrap(responseWrapperContext); context.Result = new ObjectResult(new WrapResult( - exceptionWrapContext.ErrorInfo.Code, - exceptionWrapContext.ErrorInfo.Message, + exceptionWrapContext.ErrorInfo.Code!, + exceptionWrapContext.ErrorInfo.Message!, exceptionWrapContext.ErrorInfo.Details)); context.Exception = null; //Handled! diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs index 15b43bd9d..3336bac10 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs @@ -17,6 +17,8 @@ using Volo.Abp.ExceptionHandling; namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling; +#pragma warning disable CS8625 + [Dependency(ReplaceServices = true)] [ExposeServices(typeof(AbpExceptionFilter))] public class AbpExceptionWrapResultFilter : AbpExceptionFilter, ITransientDependency @@ -44,7 +46,6 @@ public class AbpExceptionWrapResultFilter : AbpExceptionFilter, ITransientDepend { await context.HttpContext.RequestServices.GetRequiredService() .HandleAsync(context.Exception.As(), context.HttpContext); - context.Exception = null; return; @@ -84,10 +85,11 @@ public class AbpExceptionWrapResultFilter : AbpExceptionFilter, ITransientDepend httpResponseWrapper.Wrap(responseWrapperContext); context.Result = new ObjectResult(new WrapResult( - exceptionWrapContext.ErrorInfo.Code, - exceptionWrapContext.ErrorInfo.Message, + exceptionWrapContext.ErrorInfo.Code!, + exceptionWrapContext.ErrorInfo.Message!, exceptionWrapContext.ErrorInfo.Details)); context.Exception = null; //Handled! } } +#pragma warning restore CS8625 diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/WrapResultChecker.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/WrapResultChecker.cs index 44a92cd03..66a287632 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/WrapResultChecker.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/WrapResultChecker.cs @@ -47,7 +47,7 @@ public class WrapResultChecker : IWrapResultChecker, ISingletonDependency return false; } - return CheckForException(context.Exception); + return CheckForException(context.Exception!); } public bool WrapOnExecution(FilterContext context) diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/EmptyActionResultWrapper.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/EmptyActionResultWrapper.cs index b3787025e..5f8ff501d 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/EmptyActionResultWrapper.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/EmptyActionResultWrapper.cs @@ -21,7 +21,7 @@ public class EmptyActionResultWrapper : IActionResultWrapper resultExecutingContext.Result = new ObjectResult(new WrapResult(code, message)); return; } - resultExecutingContext.Result = new ObjectResult(new WrapResult(options.CodeWithSuccess, result: null)); + resultExecutingContext.Result = new ObjectResult(new WrapResult(options.CodeWithSuccess, result: null)); return; case PageHandlerExecutedContext pageHandlerExecutedContext: @@ -32,8 +32,8 @@ public class EmptyActionResultWrapper : IActionResultWrapper pageHandlerExecutedContext.Result = new ObjectResult(new WrapResult(code, message)); return; } - pageHandlerExecutedContext.Result = new ObjectResult(new WrapResult(options.CodeWithSuccess, result: null)); + pageHandlerExecutedContext.Result = new ObjectResult(new WrapResult(options.CodeWithSuccess, result: null)); return; } } -} +} \ No newline at end of file diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/JsonActionResultWrapper.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/JsonActionResultWrapper.cs index d64936d38..f67c4ebb2 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/JsonActionResultWrapper.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/JsonActionResultWrapper.cs @@ -11,7 +11,7 @@ public class JsonActionResultWrapper : IActionResultWrapper { public void Wrap(FilterContext context) { - JsonResult jsonResult = null; + JsonResult? jsonResult = null; switch (context) { @@ -33,7 +33,7 @@ public class JsonActionResultWrapper : IActionResultWrapper { var options = context.GetRequiredService>().Value; - jsonResult.Value = new WrapResult(options.CodeWithSuccess, jsonResult.Value); + jsonResult.Value = new WrapResult(options.CodeWithSuccess, jsonResult.Value); } } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ObjectActionResultWrapper.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ObjectActionResultWrapper.cs index 7fbe2b75b..c9284f2c8 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ObjectActionResultWrapper.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ObjectActionResultWrapper.cs @@ -11,7 +11,7 @@ public class ObjectActionResultWrapper : IActionResultWrapper { public void Wrap(FilterContext context) { - ObjectResult objectResult = null; + ObjectResult? objectResult = null; switch (context) { @@ -41,7 +41,7 @@ public class ObjectActionResultWrapper : IActionResultWrapper } else { - objectResult.Value = new WrapResult(options.CodeWithSuccess, objectResult.Value); + objectResult.Value = new WrapResult(options.CodeWithSuccess, objectResult.Value); } objectResult.DeclaredType = typeof(WrapResult); diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenu.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenu.cs index 93cf0266c..e1a5ad352 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenu.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenu.cs @@ -24,7 +24,7 @@ public class ApplicationMenu : IHasMenuItems, IHasExtraProperties /// 说明 /// [CanBeNull] - public string Description { get; } + public string? Description { get; } /// /// 路径 /// @@ -34,17 +34,17 @@ public class ApplicationMenu : IHasMenuItems, IHasExtraProperties /// 组件 /// [CanBeNull] - public string Component { get; } + public string? Component { get; } /// /// 重定向 /// [CanBeNull] - public string Redirect { get; } + public string? Redirect { get; } /// /// 图标 /// [CanBeNull] - public string Icon { get; set; } + public string? Icon { get; set; } /// /// 排序 /// @@ -73,9 +73,9 @@ public class ApplicationMenu : IHasMenuItems, IHasExtraProperties [NotNull] string displayName, [NotNull] string url, [CanBeNull] string component, - string description = null, - string icon = null, - string redirect = null, + string? description = null, + string? icon = null, + string? redirect = null, int order = DefaultOrder, MultiTenancySides multiTenancySides = MultiTenancySides.Both) { diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDataSeeder.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDataSeeder.cs index 026a3cc38..136819f82 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDataSeeder.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDataSeeder.cs @@ -68,6 +68,6 @@ public class NavigationDataSeeder : ITransientDependency return _options .NavigationSeedContributors .Select(type => _serviceProvider.GetRequiredService(type) as INavigationSeedContributor) - .ToList(); + .ToList()!; } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionManager.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionManager.cs index 95c58b28e..464b1c2e5 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionManager.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionManager.cs @@ -44,7 +44,7 @@ public class NavigationDefinitionManager : INavigationDefinitionManager, ISingle foreach (var provider in providers) { - provider.Define(new NavigationDefinitionContext(settings)); + provider?.Define(new NavigationDefinitionContext(settings)); } } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN/Abp/BlobStoring/Nexus/NexusBlobProvider.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN/Abp/BlobStoring/Nexus/NexusBlobProvider.cs index 3f40842a0..d870e0112 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN/Abp/BlobStoring/Nexus/NexusBlobProvider.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN/Abp/BlobStoring/Nexus/NexusBlobProvider.cs @@ -44,7 +44,7 @@ public class NexusBlobProvider : BlobProviderBase, ITransientDependency return nexusAsset != null; } - public async override Task GetOrNullAsync(BlobProviderGetArgs args) + public async override Task GetOrNullAsync(BlobProviderGetArgs args) { var nexusAsset = await GetNexusAssetOrNull(args); if (nexusAsset == null) @@ -80,7 +80,7 @@ public class NexusBlobProvider : BlobProviderBase, ITransientDependency await NexusComponentManager.UploadAsync(nexusRawBlobUploadArgs, args.CancellationToken); } - protected async virtual Task GetNexusAssetOrNull(BlobProviderArgs args) + protected async virtual Task GetNexusAssetOrNull(BlobProviderArgs args) { var nexusConfiguration = args.Configuration.GetNexusConfiguration(); var blobPath = BlobDirectoryCalculator.CalculateGroup(args.ContainerName, args.BlobName); @@ -96,7 +96,7 @@ public class NexusBlobProvider : BlobProviderBase, ITransientDependency return nexusAsset; } - protected async virtual Task GetNexusomponentOrNull(BlobProviderArgs args) + protected async virtual Task GetNexusomponentOrNull(BlobProviderArgs args) { var nexusConfiguration = args.Configuration.GetNexusConfiguration(); var blobPath = BlobDirectoryCalculator.CalculateGroup(args.ContainerName, args.BlobName); diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/INexusAssetManager.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/INexusAssetManager.cs index f3ea41370..a65d2385f 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/INexusAssetManager.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/INexusAssetManager.cs @@ -9,7 +9,7 @@ public interface INexusAssetManager { Task ListAsync( [NotNull] string repository, - string continuationToken = null, + string? continuationToken = null, CancellationToken cancellationToken = default); Task GetAsync( @@ -20,7 +20,7 @@ public interface INexusAssetManager [NotNull] string id, CancellationToken cancellationToken = default); - Task GetContentOrNullAsync( + Task GetContentOrNullAsync( [NotNull] NexusAsset asset, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAsset.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAsset.cs index 230894162..7cef309a4 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAsset.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAsset.cs @@ -6,22 +6,22 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Assets; public class NexusAsset { [JsonPropertyName("downloadUrl")] - public string DownloadUrl { get; set; } + public string? DownloadUrl { get; set; } [JsonPropertyName("path")] - public string Path { get; set; } + public string? Path { get; set; } [JsonPropertyName("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; [JsonPropertyName("repository")] - public string Repository { get; set; } + public string Repository { get; set; } = default!; [JsonPropertyName("format")] - public string Format { get; set; } + public string? Format { get; set; } [JsonPropertyName("contentType")] - public string ContentType { get; set; } + public string? ContentType { get; set; } [JsonPropertyName("lastModified")] public DateTime? LastModified { get; set; } @@ -30,5 +30,5 @@ public class NexusAsset public DateTime? BlobCreated { get; set; } [JsonPropertyName("checksum")] - public Dictionary Checksum { get; set; } + public Dictionary? Checksum { get; set; } } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAssetListResult.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAssetListResult.cs index 0632471b6..4b83628d6 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAssetListResult.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAssetListResult.cs @@ -8,8 +8,8 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Assets; public class NexusAssetListResult { [JsonPropertyName("continuationToken")] - public string ContinuationToken { get; set; } + public string ContinuationToken { get; set; } = default!; [JsonPropertyName("items")] - public List Items { get; set; } + public List Items { get; set; } = default!; } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAssetManager.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAssetManager.cs index dc6fe331c..877669de6 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAssetManager.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Assets/NexusAssetManager.cs @@ -60,7 +60,7 @@ public class NexusAssetManager : INexusAssetManager, ISingletonDependency return nexusAsset; } - public async virtual Task GetContentOrNullAsync([NotNull] NexusAsset asset, CancellationToken cancellationToken = default) + public async virtual Task GetContentOrNullAsync([NotNull] NexusAsset asset, CancellationToken cancellationToken = default) { if (asset == null || asset.DownloadUrl.IsNullOrWhiteSpace()) { @@ -72,7 +72,7 @@ public class NexusAssetManager : INexusAssetManager, ISingletonDependency return await client.GetStreamAsync(asset.DownloadUrl); } - public async virtual Task ListAsync([NotNull] string repository, string continuationToken = null, CancellationToken cancellationToken = default) + public async virtual Task ListAsync([NotNull] string repository, string? continuationToken = null, CancellationToken cancellationToken = default) { var client = HttpClientFactory.CreateClient(SonatypeNexusConsts.ApiClient); diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/INexusComponentManager.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/INexusComponentManager.cs index 1802676ad..8acc96ba1 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/INexusComponentManager.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/INexusComponentManager.cs @@ -8,7 +8,7 @@ public interface INexusComponentManager { Task ListAsync( [NotNull] string repository, - string continuationToken = null, + string? continuationToken = null, CancellationToken cancellationToken = default); Task GetAsync( diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponent.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponent.cs index af0c54213..524c8b56c 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponent.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponent.cs @@ -9,22 +9,22 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Components; public class NexusComponent { [JsonPropertyName("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; [JsonPropertyName("repository")] - public string Repository { get; set; } + public string Repository { get; set; } = default!; [JsonPropertyName("format")] - public string Format { get; set; } + public string? Format { get; set; } [JsonPropertyName("group")] - public string Group { get; set; } + public string? Group { get; set; } [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; [JsonPropertyName("version")] - public string Version { get; set; } + public string Version { get; set; } = default!; [JsonPropertyName("assets")] public List Assets { get; set; } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponentListResult.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponentListResult.cs index 4186d6107..825b23e10 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponentListResult.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponentListResult.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Components; public class NexusComponentListResult { [JsonPropertyName("continuationToken")] - public string ContinuationToken { get; set; } + public string ContinuationToken { get; set; } = default!; [JsonPropertyName("items")] public List Items { get; set; } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponentManager.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponentManager.cs index 3a91593be..91c9d3455 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponentManager.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusComponentManager.cs @@ -81,7 +81,7 @@ public class NexusComponentManager : INexusComponentManager, ISingletonDependenc return nexusComponent; } - public async virtual Task ListAsync([NotNull] string repository, string continuationToken = null, CancellationToken cancellationToken = default) + public async virtual Task ListAsync([NotNull] string repository, string? continuationToken = null, CancellationToken cancellationToken = default) { var client = HttpClientFactory.CreateClient(SonatypeNexusConsts.ApiClient); diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusRawBlobUploadArgs.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusRawBlobUploadArgs.cs index 1b781d92c..8d6048b7a 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusRawBlobUploadArgs.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Components/NexusRawBlobUploadArgs.cs @@ -6,15 +6,15 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Components; public class NexusRawBlobUploadArgs : NexusComponentUploadArgs { public Asset Asset1 { get; } - public Asset Asset2 { get; } - public Asset Asset3 { get; } + public Asset? Asset2 { get; } + public Asset? Asset3 { get; } public NexusRawBlobUploadArgs( string repository, string directory, Asset asset1, - Asset asset2 = null, - Asset asset3 = null) + Asset? asset2 = null, + Asset? asset3 = null) : base(repository, directory) { Asset1 = asset1; @@ -61,12 +61,12 @@ public class NexusRawBlobUploadArgs : NexusComponentUploadArgs if (Asset3 != null) { - var rawAsset3 = new ByteArrayContent(Asset2.FileBytes); + var rawAsset3 = new ByteArrayContent(Asset3.FileBytes); rawAsset3.Headers.ContentDisposition = ContentDispositionHeaderValue.Parse($"form-data; name=raw.asset3"); rawAsset3.Headers.ContentType = MediaTypeHeaderValue.Parse("application/octet-stream"); - rawAsset3.Headers.ContentLength = Asset2.FileBytes.Length; + rawAsset3.Headers.ContentLength = Asset3.FileBytes.Length; - var rawAsset3FileName = new StringContent(Asset2.FileName); + var rawAsset3FileName = new StringContent(Asset3.FileName); rawAsset3FileName.Headers.ContentDisposition = ContentDispositionHeaderValue.Parse($"form-data; name=raw.asset3.filename"); formDataContent.Add(rawAsset3); diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepository.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepository.cs index f04fd533b..f2bfd66a8 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepository.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepository.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Repositories; public abstract class NexusRepository { [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; [JsonPropertyName("online")] public bool Online { get; set; } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryCreateArgs.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryCreateArgs.cs index 31d680af3..5d3a2c431 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryCreateArgs.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryCreateArgs.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Repositories; public abstract class NexusRepositoryCreateArgs { [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; [JsonPropertyName("online")] public bool Online { get; set; } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryListResult.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryListResult.cs index 9ca93ebf6..4fb7d2462 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryListResult.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryListResult.cs @@ -8,16 +8,16 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Repositories; public class NexusRepositoryListResult { [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; [JsonPropertyName("format")] - public string Format { get; set; } + public string? Format { get; set; } [JsonPropertyName("type")] - public string Type { get; set; } + public string? Type { get; set; } [JsonPropertyName("url")] - public string Url { get; set; } + public string? Url { get; set; } [JsonPropertyName("attributes")] public Dictionary Attributes { get; set; } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryUpdateArgs.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryUpdateArgs.cs index 46b188b7a..ead886c2a 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryUpdateArgs.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/NexusRepositoryUpdateArgs.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Repositories; public abstract class NexusRepositoryUpdateArgs { [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; [JsonPropertyName("online")] public bool Online { get; set; } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/Raw/NexusRawRepository.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/Raw/NexusRawRepository.cs index b16666972..534f9d84c 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/Raw/NexusRawRepository.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/Raw/NexusRawRepository.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Repositories.Raw; public class NexusRawRepository : NexusRepository { [JsonPropertyName("storage")] - public RawStorage Storage { get; set; } + public RawStorage Storage { get; set; } = default!; } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/Raw/RawStorage.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/Raw/RawStorage.cs index 5c1aefb6b..232834ee2 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/Raw/RawStorage.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Repositories/Raw/RawStorage.cs @@ -7,11 +7,11 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Repositories.Raw; public class RawStorage { [JsonPropertyName("blobStoreName")] - public string BlobStoreName { get; set; } + public string BlobStoreName { get; set; } = default!; [JsonPropertyName("strictContentTypeValidation")] public bool StrictContentTypeValidation { get; set; } [JsonPropertyName("RawGroup")] - public RawGroup Group { get; set; } + public RawGroup Group { get; set; } = default!; } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Search/NexusSearchArgs.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Search/NexusSearchArgs.cs index 7593da112..5377689b1 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Search/NexusSearchArgs.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Search/NexusSearchArgs.cs @@ -1,21 +1,21 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Search; public class NexusSearchArgs { - public string Keyword { get; } + public string? Keyword { get; } public string Repository { get; } public string Group { get; } public string Name { get; } public string Format { get; set; } = "raw"; public int? Timeout { get; set; } - public string Version { get; } + public string? Version { get; } public NexusSearchArgs( string repository, string group, string name, string format = "raw", - string keyword = null, - string version = null, + string? keyword = null, + string? version = null, int? timeout = null) { Keyword = keyword; diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Assets/CoreUIAssetData.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Assets/CoreUIAssetData.cs index 265c8cce3..51df47430 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Assets/CoreUIAssetData.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Assets/CoreUIAssetData.cs @@ -8,16 +8,16 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Services.CoreUI.Assets; public class CoreUIAssetData { [JsonPropertyName("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; [JsonPropertyName("format")] - public string Format { get; set; } + public string? Format { get; set; } [JsonPropertyName("contentType")] - public string ContentType { get; set; } + public string? ContentType { get; set; } [JsonPropertyName("blobUpdated")] public DateTime? BlobUpdated { get; set; } @@ -26,29 +26,29 @@ public class CoreUIAssetData public DateTime? BlobCreated { get; set; } [JsonPropertyName("createdBy")] - public string CreatedBy { get; set; } + public string? CreatedBy { get; set; } [JsonPropertyName("createdByIp")] - public string CreatedByIp { get; set; } + public string? CreatedByIp { get; set; } [JsonPropertyName("blobRef")] - public string BlobRef { get; set; } + public string? BlobRef { get; set; } [JsonPropertyName("componentId")] - public string ComponentId { get; set; } + public string? ComponentId { get; set; } [JsonPropertyName("lastDownloaded")] - public string LastDownloaded { get; set; } + public string? LastDownloaded { get; set; } [JsonPropertyName("containingRepositoryName")] - public string ContainingRepositoryName { get; set; } + public string? ContainingRepositoryName { get; set; } [JsonPropertyName("repositoryName")] - public string RepositoryName { get; set; } + public string? RepositoryName { get; set; } [JsonPropertyName("size")] public long Size { get; set; } [JsonPropertyName("attributes")] - public Dictionary> Attributes { get; set; } + public Dictionary>? Attributes { get; set; } } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Assets/CoreUIAssetResult.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Assets/CoreUIAssetResult.cs index 1c9fdaa4b..a3a32a4b3 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Assets/CoreUIAssetResult.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Assets/CoreUIAssetResult.cs @@ -10,5 +10,5 @@ public class CoreUIAssetResult public bool Success { get; set; } [JsonPropertyName("data")] - public CoreUIAssetData Data { get; set; } + public CoreUIAssetData Data { get; set; } = default!; } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Browsers/CoreUIBrowseComponent.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Browsers/CoreUIBrowseComponent.cs index 51dfce235..836e499ae 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Browsers/CoreUIBrowseComponent.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/Browsers/CoreUIBrowseComponent.cs @@ -7,22 +7,22 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Services.CoreUI.Browsers; public class CoreUIBrowseComponent { [JsonPropertyName("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; [JsonPropertyName("assetId")] - public string AssetId { get; set; } + public string AssetId { get; set; } = default!; [JsonPropertyName("componentId")] - public string ComponentId { get; set; } + public string ComponentId { get; set; } = default!; [JsonPropertyName("packageUrl")] - public string PackageUrl { get; set; } + public string? PackageUrl { get; set; } [JsonPropertyName("text")] - public string Text { get; set; } + public string? Text { get; set; } [JsonPropertyName("type")] - public string Type { get; set; } + public string? Type { get; set; } [JsonPropertyName("leaf")] public bool Leaf { get; set; } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/CoreUIResponse.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/CoreUIResponse.cs index dc7d64e60..7cc061744 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/CoreUIResponse.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN/Abp/Sonatype/Nexus/Services/CoreUI/CoreUIResponse.cs @@ -7,17 +7,17 @@ namespace LINGYUN.Abp.Sonatype.Nexus.Services.CoreUI; public class CoreUIResponse { [JsonPropertyName("action")] - public string Action { get; set; } + public string Action { get; set; } = default!; [JsonPropertyName("method")] - public string Method { get; set; } + public string Method { get; set; } = default!; [JsonPropertyName("tid")] public long Tid { get; set; } [JsonPropertyName("type")] - public string Type { get; set; } + public string? Type { get; set; } [JsonPropertyName("result")] - public TResult Result { get; set; } + public TResult Result { get; set; } = default!; } diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN/Abp/OpenApi/Authorization/OpenApiAuthorizationService.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN/Abp/OpenApi/Authorization/OpenApiAuthorizationService.cs index e6a0f36a5..89232c965 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN/Abp/OpenApi/Authorization/OpenApiAuthorizationService.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN/Abp/OpenApi/Authorization/OpenApiAuthorizationService.cs @@ -188,7 +188,7 @@ namespace LINGYUN.Abp.OpenApi.Authorization queryDictionary.TryAdd("nonce", nonce.ToString()); queryDictionary.TryAdd("t", timeStampString.ToString()); - var requiredSign = CalculationSignature(httpContext.Request.Path.Value, queryDictionary); + var requiredSign = CalculationSignature(httpContext.Request.Path.Value!, queryDictionary); if (!string.Equals(requiredSign, sign.ToString())) { var exception = new BusinessException( @@ -243,8 +243,8 @@ namespace LINGYUN.Abp.OpenApi.Authorization exceptionWrapHandlerFactory.CreateFor(exceptionWrapContext).Wrap(exceptionWrapContext); var wrapResult = new WrapResult( - exceptionWrapContext.ErrorInfo.Code, - exceptionWrapContext.ErrorInfo.Message, + exceptionWrapContext.ErrorInfo.Code!, + exceptionWrapContext.ErrorInfo.Message!, exceptionWrapContext.ErrorInfo.Details); context.Response.Clear(); @@ -258,7 +258,7 @@ namespace LINGYUN.Abp.OpenApi.Authorization } context.Response.StatusCode = (int)HttpStatusCode.Forbidden; - await context.Response.WriteAsync(errorInfo.Message); + await context.Response.WriteAsync(errorInfo.Message!); } private static string CalculationSignature(string url, IDictionary queryDictionary) diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AppDescriptor.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AppDescriptor.cs index 149d3e5c1..c4b48518f 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AppDescriptor.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AppDescriptor.cs @@ -5,15 +5,15 @@ public class AppDescriptor /// /// 应用名称 /// - public string AppName { get; set; } + public string AppName { get; set; } = default!; /// /// 应用标识 /// - public string AppKey { get; set; } + public string AppKey { get; set; } = default!; /// /// 应用密钥 /// - public string AppSecret { get; set; } + public string AppSecret { get; set; } = default!; /// /// 应用token /// diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/NonceStateCacheItem.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/NonceStateCacheItem.cs index e0ed6382a..fcba66da3 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/NonceStateCacheItem.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/NonceStateCacheItem.cs @@ -7,7 +7,7 @@ public class NonceStateCacheItem { private const string CacheKeyFormat = "open-api,nonce:{0}"; - public string Nonce { get; set; } + public string Nonce { get; set; } = default!; public NonceStateCacheItem() { diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingAppService.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingAppService.cs index 06f171e35..57c8a5589 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingAppService.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingAppService.cs @@ -38,7 +38,7 @@ namespace LINGYUN.Abp.PushPlus.SettingManagement return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); } - protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + protected async virtual Task GetAllForProviderAsync(string providerName, string? providerKey = null) { var settingGroups = new SettingGroupResult(); var pushPlusSettingGroup = new SettingGroupDto(L["DisplayName:PushPlus"], L["Description:PushPlus"]); diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Channel/Webhook/PushPlusWebhook.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Channel/Webhook/PushPlusWebhook.cs index 0829c9cc3..dc36a4d36 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Channel/Webhook/PushPlusWebhook.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Channel/Webhook/PushPlusWebhook.cs @@ -16,12 +16,12 @@ public class PushPlusWebhook /// webhook编码 /// [JsonProperty("webhookCode")] - public string WebhookCode { get; set; } + public string WebhookCode { get; set; } = default!; /// /// webhook名称 /// [JsonProperty("webhookName")] - public string WebhookName { get; set; } + public string WebhookName { get; set; } = default!; /// /// webhook类型; /// 1-企业微信, @@ -35,7 +35,7 @@ public class PushPlusWebhook /// 调用的url地址 /// [JsonProperty("webhookUrl")] - public string WebhookUrl { get; set; } + public string WebhookUrl { get; set; } = default!; /// /// 创建日期 /// diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Message/PushPlusMessage.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Message/PushPlusMessage.cs index 2ed0aaea0..9fde931b7 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Message/PushPlusMessage.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Message/PushPlusMessage.cs @@ -13,7 +13,7 @@ public class PushPlusMessage /// webhook-第三方webhook /// [JsonProperty("channel")] - public string Channel { get; set; } + public string Channel { get; set; } = default!; /// /// 消息类型; /// 1-一对一消息, @@ -25,17 +25,17 @@ public class PushPlusMessage /// 消息短链码;可用于查询消息发送结果 /// [JsonProperty("shortCode")] - public string ShortCode { get; set; } + public string ShortCode { get; set; } = default!; /// /// 消息标题 /// [JsonProperty("title")] - public string Title { get; set; } + public string Title { get; set; } = default!; /// /// 群组名称,一对多消息才有值 /// [JsonProperty("topicName")] - public string TopicName { get; set; } + public string? TopicName { get; set; } /// /// 更新日期 /// diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Message/SendPushPlusMessageResult.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Message/SendPushPlusMessageResult.cs index 199df38a7..86b3e5fd7 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Message/SendPushPlusMessageResult.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Message/SendPushPlusMessageResult.cs @@ -18,7 +18,7 @@ public class SendPushPlusMessageResult /// 发送失败原因 /// [JsonProperty("errorMessage")] - public string ErrorMessage { get; set; } + public string? ErrorMessage { get; set; } /// /// 更新时间 /// diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/PushPlusResponse.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/PushPlusResponse.cs index 681c3e06a..73f86fc10 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/PushPlusResponse.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/PushPlusResponse.cs @@ -8,17 +8,17 @@ public class PushPlusResponse /// 状态码 /// [JsonProperty("code")] - public string Code { get; set; } + public string Code { get; set; } = default!; /// /// 错误消息 /// [JsonProperty("msg")] - public string Message { get; set; } + public string Message { get; set; } = default!; /// /// 返回数据 /// [JsonProperty("data")] - public T Data { get; set; } + public T? Data { get; set; } /// /// 是否调用成功 /// @@ -45,7 +45,7 @@ public class PushPlusResponse { ThrowOfFailed(); - return Data; + return Data!; } public void ThrowOfFailed() diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Setting/PushPlusChannel.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Setting/PushPlusChannel.cs index b8673d15c..f842b1308 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Setting/PushPlusChannel.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Setting/PushPlusChannel.cs @@ -10,17 +10,17 @@ public class PushPlusChannel /// 默认渠道编码 /// [JsonProperty("defaultChannel")] - public string DefaultChannel { get; set; } + public string? DefaultChannel { get; set; } /// /// 默认渠道名称 /// [JsonProperty("defaultChannelTxt")] - public string DefaultChannelName { get; set; } + public string? DefaultChannelName { get; set; } /// /// 渠道参数 /// [JsonProperty("defaultWebhook")] - public string DefaultWebhook { get; set; } + public string? DefaultWebhook { get; set; } /// /// 发送限制;0-无限制,1-禁止所有渠道发送,2-限制微信渠道,3-限制邮件渠道 /// diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Token/PushPlusToken.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Token/PushPlusToken.cs index eb23106d7..5cd3dd1c5 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Token/PushPlusToken.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Token/PushPlusToken.cs @@ -8,7 +8,7 @@ public class PushPlusToken /// 访问令牌,后续请求需加到header中 /// [JsonProperty("accessKey")] - public string AccessKey { get; set; } + public string AccessKey { get; set; } = default!; /// /// 过期时间,过期后需要重新获取 /// diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Token/PushPlusTokenCacheItem.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Token/PushPlusTokenCacheItem.cs index c4b0b114d..d9142c18c 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Token/PushPlusTokenCacheItem.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Token/PushPlusTokenCacheItem.cs @@ -4,7 +4,7 @@ public class PushPlusTokenCacheItem { public const string KeyFormat = "t:{0};s:{1}"; - public string AccessKey { get; set; } + public string AccessKey { get; set; } = default!; public int ExpiresIn { get; set; } diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopic.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopic.cs index 703f3a108..f522afff8 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopic.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopic.cs @@ -16,12 +16,12 @@ public class PushPlusTopic /// 群组编码 /// [JsonProperty("topicCode")] - public string TopicCode { get; set; } + public string TopicCode { get; set; } = default!; /// /// 群组名称 /// [JsonProperty("topicName")] - public string TopicName { get; set; } + public string TopicName { get; set; } = default!; /// /// 创建时间 /// diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicForMe.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicForMe.cs index 41d93b1af..8fa1fa59f 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicForMe.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicForMe.cs @@ -10,10 +10,10 @@ public class PushPlusTopicForMe : PushPlusTopic /// 联系方式 /// [JsonProperty("contact")] - public string Contact { get; set; } + public string? Contact { get; set; } /// /// 群组简介 /// [JsonProperty("introduction")] - public string Introduction { get; set; } + public string? Introduction { get; set; } } diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicProfile.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicProfile.cs index b4bd1844b..e84cf9df6 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicProfile.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicProfile.cs @@ -10,25 +10,25 @@ public class PushPlusTopicProfile : PushPlusTopic /// 永久二维码图片地址 /// [JsonProperty("qrCodeImgUrl")] - public string QrCodeImgUrl { get; set; } + public string? QrCodeImgUrl { get; set; } /// /// 联系方式 /// [JsonProperty("contact")] - public string Contact { get; set; } + public string? Contact { get; set; } /// /// 群组简介 /// [JsonProperty("introduction")] - public string Introduction { get; set; } + public string? Introduction { get; set; } /// /// 加入后回复内容 /// [JsonProperty("receiptMessage")] - public string ReceiptMessage { get; set; } + public string? ReceiptMessage { get; set; } /// /// 群组订阅人总数 /// [JsonProperty("topicUserCount")] - public string TopicUserCount { get; set; } + public string? TopicUserCount { get; set; } } diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicQrCode.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicQrCode.cs index 7cde3ec8f..68ef32879 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicQrCode.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicQrCode.cs @@ -8,7 +8,7 @@ public class PushPlusTopicQrCode /// 群组二维码图片路径 /// [JsonProperty("qrCodeImgUrl")] - public string QrCodeImgUrl { get; set; } + public string QrCodeImgUrl { get; set; } = default!; /// /// 二维码类型; /// 0-临时二维码, diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicUser.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicUser.cs index 25383c647..ea5325523 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicUser.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/Topic/PushPlusTopicUser.cs @@ -14,17 +14,17 @@ public class PushPlusTopicUser /// 昵称 /// [JsonProperty("nickName")] - public string NickName { get; set; } + public string? NickName { get; set; } /// /// 用户微信openId /// [JsonProperty("openId")] - public string OpenId { get; set; } + public string? OpenId { get; set; } /// /// 头像url地址 /// [JsonProperty("headImgUrl")] - public string HeadImgUrl { get; set; } + public string? HeadImgUrl { get; set; } /// /// 头像url地址 /// diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/User/PushPlusUserLimitTime.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/User/PushPlusUserLimitTime.cs index 84b0f5cdf..89cda21e3 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/User/PushPlusUserLimitTime.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/User/PushPlusUserLimitTime.cs @@ -16,5 +16,5 @@ public class PushPlusUserLimitTime /// 解封时间 /// [JsonProperty("userLimitTime")] - public string UserLimitTime { get; set; } + public string? UserLimitTime { get; set; } } diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/User/PushPlusUserProfile.cs b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/User/PushPlusUserProfile.cs index 5e2620e3f..8b9af5f0d 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/User/PushPlusUserProfile.cs +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN/Abp/PushPlus/User/PushPlusUserProfile.cs @@ -9,22 +9,22 @@ public class PushPlusUserProfile /// 用户微信的openId /// [JsonProperty("openId")] - public string OpenId { get; set; } + public string? OpenId { get; set; } /// /// 用户微信的unionId /// [JsonProperty("unionId")] - public string UnionId { get; set; } + public string? UnionId { get; set; } /// /// 昵称 /// [JsonProperty("nickName")] - public string NickName { get; set; } + public string? NickName { get; set; } /// /// 头像 /// [JsonProperty("headImgUrl")] - public string HeadImgUrl { get; set; } + public string? HeadImgUrl { get; set; } /// /// 性别; /// 0-未设置, @@ -37,17 +37,17 @@ public class PushPlusUserProfile /// 用户令牌 /// [JsonProperty("token")] - public string Token { get; set; } + public string? Token { get; set; } /// /// 手机号 /// [JsonProperty("phoneNumber")] - public string PhoneNumber { get; set; } + public string? PhoneNumber { get; set; } /// /// 邮箱 /// [JsonProperty("email")] - public string Email { get; set; } + public string? Email { get; set; } /// /// 邮箱验证状态; /// 0-未验证, diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/ActionInterceptor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/ActionInterceptor.cs index e79486f6e..83ce0d3b8 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/ActionInterceptor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/ActionInterceptor.cs @@ -6,8 +6,8 @@ namespace LINGYUN.Abp.Rules.NRules; public class ActionInterceptor : IActionInterceptor { - public void Intercept(IContext context, IEnumerable actions) + public void Intercept(IContext context, IReadOnlyCollection actions) { - // TODO: Intercept + } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/DependencyResolver.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/DependencyResolver.cs index f6f20d682..617ebd08d 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/DependencyResolver.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/DependencyResolver.cs @@ -15,6 +15,6 @@ public class DependencyResolver : IDependencyResolver public object Resolve(IResolutionContext context, Type serviceType) { - return _serviceProvider.GetService(serviceType); + return _serviceProvider.GetService(serviceType)!; } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/NRulesContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/NRulesContributor.cs index 8ef96ecc0..4806dc17e 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/NRulesContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/NRulesContributor.cs @@ -29,7 +29,7 @@ public class NRulesContributor : RuleContributorBase, ISingletonDependency .Load(loader => loader.From(_options.DefinitionRules)); } - public override Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) + public override Task ExecuteAsync(T input, object[]? @params = null, CancellationToken cancellationToken = default) { using (var scope = _serviceProvider.CreateScope()) { diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleActivator.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleActivator.cs index dbda46c17..8ec575ced 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleActivator.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleActivator.cs @@ -29,6 +29,6 @@ public class RuleActivator : IRuleActivator private static IEnumerable ActivateDefault(Type type) { - yield return (Rule)Activator.CreateInstance(type); + yield return (Rule)Activator.CreateInstance(type)!; } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/FileProviderWorkflowsResolveContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/FileProviderWorkflowsResolveContributor.cs index c25cd3008..695326f67 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/FileProviderWorkflowsResolveContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/FileProviderWorkflowsResolveContributor.cs @@ -13,10 +13,9 @@ namespace LINGYUN.Abp.Rules.RulesEngine.FileProviders; public abstract class FileProviderWorkflowsResolveContributor : WorkflowsResolveContributorBase { - protected IMemoryCache RulesCache { get; private set; } - protected IJsonSerializer JsonSerializer { get; private set; } - - protected IFileProvider FileProvider { get; private set; } + protected IMemoryCache RulesCache { get; private set; } = default!; + protected IJsonSerializer JsonSerializer { get; private set; } = default!; + protected IFileProvider? FileProvider { get; private set; } protected FileProviderWorkflowsResolveContributor() { } @@ -35,7 +34,7 @@ public abstract class FileProviderWorkflowsResolveContributor : WorkflowsResolve { } - protected abstract IFileProvider BuildFileProvider(RulesInitializationContext context); + protected abstract IFileProvider? BuildFileProvider(RulesInitializationContext context); public async override Task ResolveAsync(IWorkflowsResolveContext context) { @@ -60,13 +59,15 @@ public abstract class FileProviderWorkflowsResolveContributor : WorkflowsResolve var ruleId = GetRuleId(type); - return await RulesCache.GetOrCreateAsync(ruleId, - async (entry) => - { - entry.SetAbsoluteExpiration(TimeSpan.FromMinutes(30)); + var workflows = RulesCache.Get(ruleId); + if (workflows == null) + { + workflows = await GetFileSystemRulesAsync(type, cancellationToken); + + RulesCache.Set(ruleId, workflows); + } - return await GetFileSystemRulesAsync(type, cancellationToken); - }); + return workflows; } protected abstract int GetRuleId(Type type); @@ -76,12 +77,12 @@ public abstract class FileProviderWorkflowsResolveContributor : WorkflowsResolve { var ruleId = GetRuleId(type); var ruleFile = GetRuleName(type); - var fileInfo = FileProvider.GetFileInfo(ruleFile); + var fileInfo = FileProvider?.GetFileInfo(ruleFile); if (fileInfo != null && fileInfo.Exists) { // 规则文件监控 ChangeToken.OnChange( - () => FileProvider.Watch(ruleFile), + () => FileProvider!.Watch(ruleFile), (int ruleId) => { // 清除规则缓存 @@ -91,7 +92,11 @@ public abstract class FileProviderWorkflowsResolveContributor : WorkflowsResolve // 打开文本流 using var stream = fileInfo.CreateReadStream(); var result = new byte[stream.Length]; - await stream.ReadAsync(result, 0, (int)stream.Length); +#if NETSTANDARD2_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER + await stream.ReadAsync(result, 0, result.Length, cancellationToken); +#else + await stream.ReadExactlyAsync(result, 0, result.Length, cancellationToken); +#endif var ruleDsl = Encoding.UTF8.GetString(result); // 解析 return JsonSerializer.Deserialize(ruleDsl); diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/AbpRulesEnginePhysicalFileResolveOptions.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/AbpRulesEnginePhysicalFileResolveOptions.cs index 7a29c3f68..32a4b7a5e 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/AbpRulesEnginePhysicalFileResolveOptions.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/AbpRulesEnginePhysicalFileResolveOptions.cs @@ -5,5 +5,5 @@ public class AbpRulesEnginePhysicalFileResolveOptions /// /// 本地文件路径 /// - public string PhysicalPath { get; set; } + public string PhysicalPath { get; set; } = default!; } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/PhysicalFileWorkflowsResolveContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/PhysicalFileWorkflowsResolveContributor.cs index 14027ec7e..05303b332 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/PhysicalFileWorkflowsResolveContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/PhysicalFileWorkflowsResolveContributor.cs @@ -11,9 +11,9 @@ public class PhysicalFileWorkflowsResolveContributor : FileProviderWorkflowsReso { public override string Name => "PhysicalFile"; - private RuleIdGenerator _ruleIdGenerator; - private AbpRulesEngineOptions _rulesEngineOptions; - private AbpRulesEnginePhysicalFileResolveOptions _fileResolveOptions; + private RuleIdGenerator _ruleIdGenerator = default!; + private AbpRulesEngineOptions _rulesEngineOptions = default!; + private AbpRulesEnginePhysicalFileResolveOptions _fileResolveOptions = default!; public PhysicalFileWorkflowsResolveContributor() { @@ -26,7 +26,7 @@ public class PhysicalFileWorkflowsResolveContributor : FileProviderWorkflowsReso _fileResolveOptions = serviceProvider.GetRequiredService>().Value; } - protected override IFileProvider BuildFileProvider(RulesInitializationContext context) + protected override IFileProvider? BuildFileProvider(RulesInitializationContext context) { // 未指定路径不启用 if (!_fileResolveOptions.PhysicalPath.IsNullOrWhiteSpace() && diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContext.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContext.cs index b4101d395..5d928c2d0 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContext.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContext.cs @@ -9,7 +9,7 @@ namespace LINGYUN.Abp.Rules.RulesEngine; public interface IWorkflowsResolveContext : IServiceProviderAccessor { [CanBeNull] - IEnumerable Workflows { get; set; } + IEnumerable? Workflows { get; set; } [NotNull] Type Type { get; } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/IWorkflowStore.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/IWorkflowStore.cs index e01122952..a7e0ba99f 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/IWorkflowStore.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/IWorkflowStore.cs @@ -13,5 +13,5 @@ public interface IWorkflowStore { Task> GetWorkflowsAsync(Type inputType, CancellationToken cancellationToken = default); - Task GetWorkflowAsync(string workflowName, CancellationToken cancellationToken = default); + Task GetWorkflowAsync(string workflowName, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/NullWorkflowStore.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/NullWorkflowStore.cs index 1e97c156e..c345c0551 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/NullWorkflowStore.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/NullWorkflowStore.cs @@ -10,9 +10,9 @@ namespace LINGYUN.Abp.Rules.RulesEngine.Persistent; [Dependency(TryRegister = true)] public class NullWorkflowStore : IWorkflowStore, ISingletonDependency { - public Task GetWorkflowAsync(string workflowName, CancellationToken cancellationToken = default) + public Task GetWorkflowAsync(string workflowName, CancellationToken cancellationToken = default) { - return Task.FromResult(null); + return Task.FromResult(null); } public Task> GetWorkflowsAsync(Type inputType, CancellationToken cancellationToken = default) diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/RulesEngineContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/RulesEngineContributor.cs index 61075e484..95f764aa9 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/RulesEngineContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/RulesEngineContributor.cs @@ -14,8 +14,11 @@ public class RulesEngineContributor : RuleContributorBase, ISingletonDependency private readonly IRulesEngine _ruleEngine; private readonly IWorkflowsResolver _workflowRulesResolver; - public RulesEngineContributor(IWorkflowsResolver workflowRulesResolver) + public RulesEngineContributor( + IRulesEngine ruleEngine, + IWorkflowsResolver workflowRulesResolver) { + _ruleEngine = ruleEngine; _workflowRulesResolver = workflowRulesResolver; } @@ -24,7 +27,7 @@ public class RulesEngineContributor : RuleContributorBase, ISingletonDependency _workflowRulesResolver.Initialize(context); } - public override async Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) + public override async Task ExecuteAsync(T input, object[]? @params = null, CancellationToken cancellationToken = default) { var result = await _workflowRulesResolver.ResolveWorkflowsAsync(typeof(T)); @@ -39,7 +42,7 @@ public class RulesEngineContributor : RuleContributorBase, ISingletonDependency _workflowRulesResolver.Shutdown(); } - protected async virtual Task ExecuteRulesAsync(T input, Workflow[] workflows, object[] @params = null) + protected async virtual Task ExecuteRulesAsync(T input, Workflow[] workflows, object[]? @params = null) where T : notnull { // TODO: 性能缺陷 规则文件每一次调用都会重复编译 _ruleEngine.AddOrUpdateWorkflow(workflows); diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContext.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContext.cs index 78613dd74..4e1d250ac 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContext.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContext.cs @@ -11,7 +11,7 @@ public class WorkflowsResolveContext : IWorkflowsResolveContext { public Type Type { get; } public IServiceProvider ServiceProvider { get; } - public IEnumerable Workflows { get; set; } + public IEnumerable? Workflows { get; set; } public bool Handled { get; set; } public bool HasResolved() diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/RulesEngine/ListofRuleResultTreeExtension.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/RulesEngine/ListofRuleResultTreeExtension.cs index da1906321..09f01f1ea 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/RulesEngine/ListofRuleResultTreeExtension.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/RulesEngine/ListofRuleResultTreeExtension.cs @@ -28,7 +28,7 @@ public static class ListofRuleResultTreeExtension foreach (var failedResult in failedResults) { - string member = null; + string? member = null; var errorBuilder = new StringBuilder(36); if (!failedResult.ExceptionMessage.IsNullOrWhiteSpace()) { @@ -49,13 +49,13 @@ public static class ListofRuleResultTreeExtension - private static string GetErrorMessage(this IEnumerable ruleResultTrees, out string member) + private static string GetErrorMessage(this IEnumerable ruleResultTrees, out string? member) { member = null; var errorBuilder = new StringBuilder(36); var failedResults = ruleResultTrees.Where(rule => !rule.IsSuccess).ToArray(); - for (int index = 0; index < failedResults.Length; index++) + for (var index = 0; index < failedResults.Length; index++) { member = failedResults[index].Rule?.Properties?.GetOrDefault("Property")?.ToString(); diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleContributor.cs index 24b410641..5a0290c4c 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleContributor.cs @@ -7,7 +7,7 @@ public interface IRuleContributor { void Initialize(RulesInitializationContext context); - Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default); + Task ExecuteAsync(T input, object[]? @params = null, CancellationToken cancellationToken = default) where T: notnull; void Shutdown(); } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleProvider.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleProvider.cs index 30191df5e..dde87bd2b 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleProvider.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleProvider.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.Rules; public interface IRuleProvider { - Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default); + Task ExecuteAsync(T input, object[]? @params = null, CancellationToken cancellationToken = default) where T : notnull; } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleContributorBase.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleContributorBase.cs index fd5cb787c..97f1c5f7c 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleContributorBase.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleContributorBase.cs @@ -18,7 +18,7 @@ public abstract class RuleContributorBase : IRuleContributor { } - public virtual Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) + public virtual Task ExecuteAsync(T input, object[]? @params = null, CancellationToken cancellationToken = default) where T : notnull { return Task.CompletedTask; } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleProvider.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleProvider.cs index f339b9776..20bcfdf4e 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleProvider.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleProvider.cs @@ -32,7 +32,7 @@ public class RuleProvider : IRuleProvider, ISingletonDependency _serviceProvider = serviceProvider; } - public async virtual Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) + public async virtual Task ExecuteAsync(T input, object[]? @params = null, CancellationToken cancellationToken = default) where T: notnull { _logger.LogDebug("Starting all typed rules engine."); diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RulesInitializationContext.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RulesInitializationContext.cs index d5cf9700c..3041a80c2 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RulesInitializationContext.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RulesInitializationContext.cs @@ -15,5 +15,5 @@ public class RulesInitializationContext : IServiceProvider, IHasExtraProperties ExtraProperties = new ExtraPropertyDictionary(); } - public object GetService(Type serviceType) => ServiceProvider.GetService(serviceType); + public object? GetService(Type serviceType) => ServiceProvider.GetService(serviceType); } diff --git a/aspnet-core/framework/security/LINGYUN.Abp.Claims.Mapping/Microsoft/IdentityModel/Tokens/TokenWildcardIssuerValidator.cs b/aspnet-core/framework/security/LINGYUN.Abp.Claims.Mapping/Microsoft/IdentityModel/Tokens/TokenWildcardIssuerValidator.cs index 42646c01c..ef67f0284 100644 --- a/aspnet-core/framework/security/LINGYUN.Abp.Claims.Mapping/Microsoft/IdentityModel/Tokens/TokenWildcardIssuerValidator.cs +++ b/aspnet-core/framework/security/LINGYUN.Abp.Claims.Mapping/Microsoft/IdentityModel/Tokens/TokenWildcardIssuerValidator.cs @@ -103,7 +103,7 @@ public static class TokenWildcardIssuerValidator }); }; - private static string SerializeAsSingleCommaDelimitedString(IEnumerable strings) + private static string SerializeAsSingleCommaDelimitedString(IEnumerable? strings) { if (strings == null) { diff --git a/aspnet-core/framework/security/LINGYUN.Abp.Encryption.SM4/LINGYUN.Abp.Encryption.SM4.csproj b/aspnet-core/framework/security/LINGYUN.Abp.Encryption.SM4/LINGYUN.Abp.Encryption.SM4.csproj index b292f8968..a22e5991e 100644 --- a/aspnet-core/framework/security/LINGYUN.Abp.Encryption.SM4/LINGYUN.Abp.Encryption.SM4.csproj +++ b/aspnet-core/framework/security/LINGYUN.Abp.Encryption.SM4/LINGYUN.Abp.Encryption.SM4.csproj @@ -4,7 +4,7 @@ - netstandard2.0;netstandard2.1;net8.0;net9.0;net10.0 + net8.0;net9.0;net10.0 LINGYUN.Abp.Encryption.SM4 LINGYUN.Abp.Encryption.SM4 false diff --git a/aspnet-core/framework/security/LINGYUN.Abp.Encryption.SM4/LINGYUN/Abp/Encryption/SM4/SM4StringEncryptionService.cs b/aspnet-core/framework/security/LINGYUN.Abp.Encryption.SM4/LINGYUN/Abp/Encryption/SM4/SM4StringEncryptionService.cs index a3d37ea52..8a95499f3 100644 --- a/aspnet-core/framework/security/LINGYUN.Abp.Encryption.SM4/LINGYUN/Abp/Encryption/SM4/SM4StringEncryptionService.cs +++ b/aspnet-core/framework/security/LINGYUN.Abp.Encryption.SM4/LINGYUN/Abp/Encryption/SM4/SM4StringEncryptionService.cs @@ -22,7 +22,7 @@ public class SM4StringEncryptionService : StringEncryptionService { } - public override string Decrypt(string cipherText, string passPhrase = null, byte[] salt = null) + public override string? Decrypt(string? cipherText, string? passPhrase = null, byte[]? salt = null) { if (string.IsNullOrEmpty(cipherText)) { @@ -33,11 +33,7 @@ public class SM4StringEncryptionService : StringEncryptionService salt ??= Options.DefaultSalt; var cipherTextBytes = Convert.FromBase64String(cipherText); - - using var password = new Rfc2898DeriveBytes(passPhrase, salt); - // 128-bit key - var keyBytes = password.GetBytes(16); - + var keyBytes = Rfc2898DeriveBytes.Pbkdf2(passPhrase, salt, 1000, HashAlgorithmName.SHA256, 16); var cipher = new PaddedBufferedBlockCipher(new CbcBlockCipher(new SM4Engine()), new Pkcs7Padding()); cipher.Init(false, new ParametersWithIV(new KeyParameter(keyBytes), Options.InitVectorBytes)); @@ -46,7 +42,7 @@ public class SM4StringEncryptionService : StringEncryptionService return Encoding.UTF8.GetString(decryptTextBytes); } - public override string Encrypt(string plainText, string passPhrase = null, byte[] salt = null) + public override string? Encrypt(string? plainText, string? passPhrase = null, byte[]? salt = null) { if (plainText == null) { @@ -57,10 +53,7 @@ public class SM4StringEncryptionService : StringEncryptionService salt ??= Options.DefaultSalt; var plainTextBytes = Encoding.UTF8.GetBytes(plainText); - using var password = new Rfc2898DeriveBytes(passPhrase, salt); - // 128-bit key - var keyBytes = password.GetBytes(16); - + var keyBytes = Rfc2898DeriveBytes.Pbkdf2(passPhrase, salt, 1000, HashAlgorithmName.SHA256, 16); var cipher = new PaddedBufferedBlockCipher(new CbcBlockCipher(new SM4Engine()), new Pkcs7Padding()); cipher.Init(true, new ParametersWithIV(new KeyParameter(keyBytes), Options.InitVectorBytes)); diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/OptionDto.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/OptionDto.cs index 4c5ab59be..af13fd7b5 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/OptionDto.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/OptionDto.cs @@ -2,15 +2,15 @@ public class OptionDto { - public string Name { get; set; } - public string Value { get; set; } + public string Name { get; set; } = default!; + public string? Value { get; set; } public OptionDto() { } - public OptionDto(string name, string value) + public OptionDto(string name, string? value) { Name = name; Value = value; diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDetailsDto.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDetailsDto.cs index b7a6fe1f9..a465b38f6 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDetailsDto.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDetailsDto.cs @@ -6,15 +6,15 @@ namespace LINGYUN.Abp.SettingManagement; public class SettingDetailsDto { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; - public string Description { get; set; } + public string? Description { get; set; } - public string Value { get; set; } + public string? Value { get; set; } - public string DefaultValue { get; set; } + public string? DefaultValue { get; set; } public bool IsEncrypted { get; set; } @@ -22,7 +22,7 @@ public class SettingDetailsDto /// /// 插槽,前端定义控件 /// - public string Slot { get; set; } + public string? Slot { get; set; } /// /// 选项列表,仅当 ValueType 为 Option有效 /// @@ -41,7 +41,7 @@ public class SettingDetailsDto return this; } - public SettingDetailsDto AddOption(string name, string value) + public SettingDetailsDto AddOption(string name, string? value) { Options.Add(new OptionDto { diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDto.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDto.cs index 4ad3b84b4..ac058477b 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDto.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDto.cs @@ -9,9 +9,9 @@ namespace LINGYUN.Abp.SettingManagement; public class SettingDto { - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; - public string Description { get; set; } + public string? Description { get; set; } public List Details { get; set; } = new List(); @@ -32,7 +32,7 @@ public class SettingDto public SettingDetailsDto? AddDetail( SettingDefinition setting, IStringLocalizerFactory factory, - string value, + string? value, ValueType type, string keepProvider = "") { diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupDto.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupDto.cs index bf800e4b0..1ed031b54 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupDto.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupDto.cs @@ -4,9 +4,9 @@ namespace LINGYUN.Abp.SettingManagement; public class SettingGroupDto { - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; - public string Description { get; set; } + public string? Description { get; set; } public List Settings { get; set; } = new List(); diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingDto.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingDto.cs index 71176cd1a..eeae732a5 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingDto.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingDto.cs @@ -8,8 +8,8 @@ public class UpdateSettingDto { [Required] [DynamicStringLength(typeof(SettingConsts), nameof(SettingConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [DynamicStringLength(typeof(SettingConsts), nameof(SettingConsts.MaxValueLength))] - public string Value { get; set; } + public string? Value { get; set; } } diff --git a/aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/Microsoft/Extensions/DependencyInjection/SkyWalkingServiceCollectionExtensions.cs b/aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/Microsoft/Extensions/DependencyInjection/SkyWalkingServiceCollectionExtensions.cs index 6b6a942a6..b0908831c 100644 --- a/aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/Microsoft/Extensions/DependencyInjection/SkyWalkingServiceCollectionExtensions.cs +++ b/aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.SkyWalking/Microsoft/Extensions/DependencyInjection/SkyWalkingServiceCollectionExtensions.cs @@ -27,7 +27,7 @@ namespace Microsoft.Extensions.DependencyInjection; internal static class SkyWalkingServiceCollectionExtensions { - public static IServiceCollection AddSkyWalking(this IServiceCollection services, Action extensionsSetup = null) + public static IServiceCollection AddSkyWalking(this IServiceCollection services, Action? extensionsSetup = null) { Check.NotNull(extensionsSetup, nameof(extensionsSetup)); @@ -91,8 +91,8 @@ internal static class SkyWalkingServiceCollectionExtensions private static IServiceCollection AddSampling(this IServiceCollection services) { services.AddSingleton(); - services.AddSingleton((Func)((IServiceProvider p) => p.GetService())); - services.AddSingleton((Func)((IServiceProvider p) => p.GetService())); + services.AddSingleton((Func)((IServiceProvider p) => p.GetRequiredService())); + services.AddSingleton((Func)((IServiceProvider p) => p.GetRequiredService())); services.AddSingleton(); services.AddSingleton(); return services; diff --git a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionClaimsPrincipalContributor.cs b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionClaimsPrincipalContributor.cs index 06b64dc04..0b15375ea 100644 --- a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionClaimsPrincipalContributor.cs +++ b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionClaimsPrincipalContributor.cs @@ -26,6 +26,10 @@ public class EditionClaimsPrincipalContributor : IAbpClaimsPrincipalContributor, } var claimsIdentity = context.ClaimsPrincipal.Identities.FirstOrDefault(); + if (claimsIdentity == null) + { + return; + } if (claimsIdentity.FindAll(x => x.Type == AbpClaimTypes.EditionId).Any()) { return; diff --git a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionConfiguration.cs b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionConfiguration.cs index 935156c6e..4073f437e 100644 --- a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionConfiguration.cs +++ b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionConfiguration.cs @@ -9,7 +9,7 @@ public class EditionConfiguration { public Guid Id { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public EditionConfiguration() { diff --git a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionConfigurationProvider.cs b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionConfigurationProvider.cs index 50a6f3f47..b2d4bdef1 100644 --- a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionConfigurationProvider.cs +++ b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionConfigurationProvider.cs @@ -13,9 +13,9 @@ public class EditionConfigurationProvider : IEditionConfigurationProvider, ITran EditionStore = editionStore; } - public async virtual Task GetAsync(Guid? tenantId = null) + public async virtual Task GetAsync(Guid? tenantId = null) { - EditionConfiguration edition = null; + EditionConfiguration? edition = null; if (tenantId.HasValue) { var editionInfo = await EditionStore.FindByTenantAsync(tenantId.Value); diff --git a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionInfo.cs b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionInfo.cs index aef3d6743..64ba87fcb 100644 --- a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionInfo.cs +++ b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionInfo.cs @@ -9,7 +9,7 @@ public class EditionInfo { public Guid Id { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public EditionInfo() { diff --git a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/IEditionConfigurationProvider.cs b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/IEditionConfigurationProvider.cs index 80d81860b..9e31c49ce 100644 --- a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/IEditionConfigurationProvider.cs +++ b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/IEditionConfigurationProvider.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.MultiTenancy.Editions; public interface IEditionConfigurationProvider { - Task GetAsync(Guid? tenantId = null); + Task GetAsync(Guid? tenantId = null); } diff --git a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/IEditionStore.cs b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/IEditionStore.cs index 1b2de5019..679bed95e 100644 --- a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/IEditionStore.cs +++ b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/IEditionStore.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.MultiTenancy.Editions; public interface IEditionStore { - Task FindByTenantAsync(Guid tenantId); + Task FindByTenantAsync(Guid tenantId); } diff --git a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/Volo/Abp/GlobalFeatures/GlobalModuleFeaturesDictionaryEditionsExtensions.cs b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/Volo/Abp/GlobalFeatures/GlobalModuleFeaturesDictionaryEditionsExtensions.cs index 7b2b8c3dc..889f9e5ca 100644 --- a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/Volo/Abp/GlobalFeatures/GlobalModuleFeaturesDictionaryEditionsExtensions.cs +++ b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/Volo/Abp/GlobalFeatures/GlobalModuleFeaturesDictionaryEditionsExtensions.cs @@ -16,8 +16,7 @@ public static class GlobalModuleFeaturesDictionaryEditionsExtensions .GetOrAdd( GlobalEditionsFeatures.ModuleName, _ => new GlobalEditionsFeatures(modules.FeatureManager) - ) - as GlobalEditionsFeatures; + ).As(); } public static GlobalModuleFeaturesDictionary Editions( diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/AbpWeChatWorkClaimsPrincipalContributor.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/AbpWeChatWorkClaimsPrincipalContributor.cs index 7087e0c6d..de99a4701 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/AbpWeChatWorkClaimsPrincipalContributor.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/AbpWeChatWorkClaimsPrincipalContributor.cs @@ -20,17 +20,21 @@ public class AbpWeChatWorkClaimsPrincipalContributor : IAbpClaimsPrincipalContri return; } var userId = claimsIdentity.FindUserId(); - if (userId.HasValue) + if (!userId.HasValue) { - var userClaimProvider = context.ServiceProvider.GetService(); - - var weChatWorkUserId = await userClaimProvider?.FindUserIdentifierAsync(userId.Value); - if (!weChatWorkUserId.IsNullOrWhiteSpace()) - { - claimsIdentity.AddOrReplace(new Claim(AbpWeChatWorkClaimTypes.UserId, weChatWorkUserId)); + return; + } + var userClaimProvider = context.ServiceProvider.GetService(); + if (userClaimProvider == null) + { + return; + } + var weChatWorkUserId = await userClaimProvider.FindUserIdentifierAsync(userId.Value); + if (!weChatWorkUserId.IsNullOrWhiteSpace()) + { + claimsIdentity.AddOrReplace(new Claim(AbpWeChatWorkClaimTypes.UserId, weChatWorkUserId)); - context.ClaimsPrincipal.AddIdentityIfNotContains(claimsIdentity); - } + context.ClaimsPrincipal.AddIdentityIfNotContains(claimsIdentity); } } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/WeChatWorkUserClaimProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/WeChatWorkUserClaimProvider.cs index fda85cb68..3991f7142 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/WeChatWorkUserClaimProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/WeChatWorkUserClaimProvider.cs @@ -24,17 +24,7 @@ public class WeChatWorkUserClaimProvider : IWeChatWorkUserClaimProvider UserManager = userManager; } - protected string GetUserOpenIdOrNull(IdentityUser user, string provider) - { - // 微信扩展登录后openid存储在Login中 - var userLogin = user?.Logins - .Where(login => login.LoginProvider == provider) - .FirstOrDefault(); - - return userLogin?.ProviderKey; - } - - public async virtual Task FindUserIdentifierAsync(Guid userId, CancellationToken cancellationToken = default) + public async virtual Task FindUserIdentifierAsync(Guid userId, CancellationToken cancellationToken = default) { var user = await UserManager.FindByIdAsync(userId.ToString()); @@ -74,4 +64,14 @@ public class WeChatWorkUserClaimProvider : IWeChatWorkUserClaimProvider weChatUserId, AbpWeChatWorkGlobalConsts.DisplayName)); } + + protected virtual string? GetUserOpenIdOrNull(IdentityUser? user, string provider) + { + // 微信扩展登录后openid存储在Login中 + var userLogin = user?.Logins + .Where(login => login.LoginProvider == provider) + .FirstOrDefault(); + + return userLogin?.ProviderKey; + } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/OpenId/UserWeChatOpenIdFinder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/OpenId/UserWeChatOpenIdFinder.cs index 70d459aea..19dd52c4d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/OpenId/UserWeChatOpenIdFinder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/OpenId/UserWeChatOpenIdFinder.cs @@ -20,21 +20,21 @@ public class UserWeChatOpenIdFinder : IUserWeChatOpenIdFinder UserManager = userManager; } - public async virtual Task FindByUserIdAsync(Guid userId, string provider) + public async virtual Task FindByUserIdAsync(Guid userId, string provider) { var user = await UserManager.FindByIdAsync(userId.ToString()); return GetUserOpenIdOrNull(user, provider); } - public async virtual Task FindByUserNameAsync(string userName, string provider) + public async virtual Task FindByUserNameAsync(string userName, string provider) { var user = await UserManager.FindByNameAsync(userName); return GetUserOpenIdOrNull(user, provider); } - protected string GetUserOpenIdOrNull(IdentityUser user, string provider) + protected string? GetUserOpenIdOrNull(IdentityUser? user, string provider) { // 微信扩展登录后openid存储在Login中 var userLogin = user?.Logins diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/AbpWeChatException.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/AbpWeChatException.cs index d6b245c7f..f4d46292b 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/AbpWeChatException.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/AbpWeChatException.cs @@ -10,10 +10,10 @@ public class AbpWeChatException : BusinessException } public AbpWeChatException( - string code = null, - string message = null, - string details = null, - Exception innerException = null) + string? code = null, + string? message = null, + string? details = null, + Exception? innerException = null) : base(code, message, details, innerException) { } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/AbpWeChatCryptoException.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/AbpWeChatCryptoException.cs index 54152984e..f9029a85c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/AbpWeChatCryptoException.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/AbpWeChatCryptoException.cs @@ -11,19 +11,19 @@ public class AbpWeChatCryptoException : AbpWeChatException public AbpWeChatCryptoException( string appId, - string message = null, - string details = null, - Exception innerException = null) + string? message = null, + string? details = null, + Exception? innerException = null) : this(appId, "WeChat:100400", message, details, innerException) { } public AbpWeChatCryptoException( string appId, - string code = null, - string message = null, - string details = null, - Exception innerException = null) + string? code = null, + string? message = null, + string? details = null, + Exception? innerException = null) : base(code, message, details, innerException) { WithData("AppId", appId); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/IMessageResolveContext.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/IMessageResolveContext.cs index f547f40b2..9798e760a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/IMessageResolveContext.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/IMessageResolveContext.cs @@ -7,5 +7,5 @@ public interface IMessageResolveContext : IServiceProviderAccessor string Origin { get; } XDocument MessageData { get; } bool Handled { get; set; } - WeChatMessage Message { get; set; } + WeChatMessage? Message { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/IMessageResolveContextExtensions.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/IMessageResolveContextExtensions.cs index 3cc22d533..5c6cfb76e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/IMessageResolveContextExtensions.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/IMessageResolveContextExtensions.cs @@ -5,12 +5,12 @@ public static class IMessageResolveContextExtensions { public static bool HasMessageKey(this IMessageResolveContext context, string key) { - return context.MessageData.Root.Element(key) != null; + return context.MessageData.Root?.Element(key) != null; } - public static string GetMessageData(this IMessageResolveContext context, string key) + public static string? GetMessageData(this IMessageResolveContext context, string key) { - return context.MessageData.Root.Element(key)?.Value; + return context.MessageData.Root?.Element(key)?.Value; } public static T GetWeChatMessage(this IMessageResolveContext context) where T : WeChatMessage diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/MessageResolveContext.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/MessageResolveContext.cs index 3e042f18b..527c126fc 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/MessageResolveContext.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/MessageResolveContext.cs @@ -8,7 +8,7 @@ public class MessageResolveContext : IMessageResolveContext public string Origin { get; } public XDocument MessageData { get; } public bool Handled { get; set; } - public WeChatMessage Message { get; set; } + public WeChatMessage? Message { get; set; } public bool HasResolvedMessage() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/MessageResolveResult.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/MessageResolveResult.cs index d7259a7d9..14c4dc82f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/MessageResolveResult.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/MessageResolveResult.cs @@ -5,7 +5,7 @@ public class MessageResolveResult { public string Input { get; internal set; } - public WeChatMessage Message { get; set; } + public WeChatMessage? Message { get; set; } public List AppliedResolvers { get; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/WeChatEventMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/WeChatEventMessage.cs index 7d725a604..123de18ed 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/WeChatEventMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/WeChatEventMessage.cs @@ -10,5 +10,5 @@ public abstract class WeChatEventMessage : WeChatMessage /// 事件类型 /// [XmlElement("Event")] - public string Event { get; set; } + public string Event { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/WeChatMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/WeChatMessage.cs index 558ed61d8..b557ff8d9 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/WeChatMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Messages/WeChatMessage.cs @@ -13,12 +13,12 @@ public abstract class WeChatMessage /// 开发者微信号 /// [XmlElement("ToUserName")] - public string ToUserName { get; set; } + public string ToUserName { get; set; } = default!; /// /// 发送方账号(一个OpenID) /// [XmlElement("FromUserName")] - public string FromUserName { get; set; } + public string FromUserName { get; set; } = default!; /// /// 消息创建时间 (整型) /// @@ -28,7 +28,7 @@ public abstract class WeChatMessage /// 消息类型,event /// [XmlElement("MsgType")] - public string MsgType { get; set; } + public string MsgType { get; set; } = default!; public abstract WeChatMessageEto ToEto(); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/Cryptography.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/Cryptography.cs index 303bfbb5c..4edf7ba12 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/Cryptography.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/Cryptography.cs @@ -6,6 +6,8 @@ using System.Security.Cryptography; using System.IO; using System.Net; +#nullable disable + namespace LINGYUN.Abp.WeChat.Common.Utils; public class Cryptography @@ -242,3 +244,4 @@ public class Cryptography return res; } } +#nullable enable \ No newline at end of file diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/WXBizMsgCrypt.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/WXBizMsgCrypt.cs index 7a3262441..0a1398cf3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/WXBizMsgCrypt.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/WXBizMsgCrypt.cs @@ -17,7 +17,7 @@ using System.Security.Cryptography; //-40009 : base64加密异常 //-40010 : base64解密异常 namespace LINGYUN.Abp.WeChat.Common.Utils; - +#nullable disable public class WXBizMsgCrypt { string m_sToken; @@ -260,3 +260,4 @@ public class WXBizMsgCrypt return 0; } } +#nullable enable \ No newline at end of file diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/System/WeChatXmlDataSerializeExtensions.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/System/WeChatXmlDataSerializeExtensions.cs index bef133f38..5db365305 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/System/WeChatXmlDataSerializeExtensions.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/System/WeChatXmlDataSerializeExtensions.cs @@ -36,7 +36,7 @@ public static class WeChatXmlDataSerializeExtensions using var xmlReader = XmlReader.Create(stringReader); var serializer = GetTypedSerializer(objectType); var usingEvents = events ?? new XmlDeserializationEvents(); - return (T)serializer.Deserialize(xmlReader, usingEvents); + return (T)serializer.Deserialize(xmlReader, usingEvents)!; } public static string SerializeWeChatMessage(this WeChatMessage message) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptions.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptions.cs index b68cc58bd..c8e0f945e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptions.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptions.cs @@ -5,17 +5,17 @@ public class AbpWeChatMiniProgramOptions /// /// 小程序AppId /// - public string AppId { get; set; } + public string AppId { get; set; } = default!; /// /// 小程序AppSecret /// - public string AppSecret { get; set; } + public string AppSecret { get; set; } = default!; /// /// 小程序消息解密Token /// - public string Token { get; set; } + public string Token { get; set; } = default!; /// /// 小程序消息解密AESKey /// - public string EncodingAESKey { get; set; } + public string EncodingAESKey { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatureDefinitionProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatureDefinitionProvider.cs index 2a5056683..59926c3cd 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatureDefinitionProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatureDefinitionProvider.cs @@ -17,13 +17,13 @@ public class WeChatMiniProgramFeatureDefinitionProvider : FeatureDefinitionProvi // displayName: L("Features:WeChat.MiniProgram"), // description: L("Features:WeChat.MiniProgramDesc")); - var miniProgramEnableFeature = group.AddFeature( + var miniProgramEnableFeature = group?.AddFeature( name: WeChatMiniProgramFeatures.Enable, defaultValue: true.ToString(), displayName: L("Features:WeChat.MiniProgram.Enable"), description: L("Features:WeChat.MiniProgram.EnableDesc"), valueType: new ToggleStringValueType(new BooleanValueValidator())); - miniProgramEnableFeature.CreateChild( + miniProgramEnableFeature?.CreateChild( name: WeChatMiniProgramFeatures.EnableAuthorization, defaultValue: true.ToString(), displayName: L("Features:WeChat.MiniProgram.EnableAuthorization"), @@ -31,19 +31,19 @@ public class WeChatMiniProgramFeatureDefinitionProvider : FeatureDefinitionProvi valueType: new ToggleStringValueType(new BooleanValueValidator())); - var messageEnableFeature = group.AddFeature( + var messageEnableFeature = group?.AddFeature( name: WeChatMiniProgramFeatures.Messages.Enable, defaultValue: true.ToString(), displayName: L("Features:WeChat.MiniProgram.EnableMessages"), description: L("Features:WeChat.MiniProgram.EnableMessagesDesc"), valueType: new ToggleStringValueType(new BooleanValueValidator())); - messageEnableFeature.CreateChild( + messageEnableFeature?.CreateChild( name: WeChatMiniProgramFeatures.Messages.SendLimit, defaultValue: WeChatMiniProgramFeatures.Messages.DefaultSendLimit.ToString(), displayName: L("Features:WeChat.MiniProgram.SendLimit"), description: L("Features:WeChat.MiniProgram.SendLimitDesc"), valueType: new FreeTextStringValueType(new NumericValueValidator(1, 100_0000))); - messageEnableFeature.CreateChild( + messageEnableFeature?.CreateChild( name: WeChatMiniProgramFeatures.Messages.SendLimitInterval, defaultValue: WeChatMiniProgramFeatures.Messages.DefaultSendLimitInterval.ToString(), displayName: L("Features:WeChat.MiniProgram.SendLimitInterval"), diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/ISubscribeMessager.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/ISubscribeMessager.cs index 42b7318e0..2e23eb5c3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/ISubscribeMessager.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/ISubscribeMessager.cs @@ -35,9 +35,9 @@ public interface ISubscribeMessager Task SendAsync( Guid toUser, string templateId, - string page = "", - string lang = "zh_CN", - string state = "formal", - Dictionary data = null, + string? page = "", + string? lang = "zh_CN", + string? state = "formal", + Dictionary? data = null, CancellationToken cancellation = default); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/Response.SubscribeMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/Response.SubscribeMessage.cs index e737e42c6..d1e77a740 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/Response.SubscribeMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/Response.SubscribeMessage.cs @@ -9,7 +9,7 @@ public class SubscribeMessageResponse public int ErrorCode { get; set; } [JsonProperty("errmsg")] - public string ErrorMessage { get; set; } + public string? ErrorMessage { get; set; } public bool IsSuccessed => ErrorCode == 0; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessage.cs index f1d6decaa..1c704ef7d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessage.cs @@ -9,33 +9,33 @@ public class SubscribeMessage /// 接收者(用户)的 openid /// [JsonProperty("touser")] - public string ToUser { get; set; } + public string ToUser { get; set; } = default!; /// /// 所需下发的订阅模板id /// [JsonProperty("template_id")] - public string TemplateId { get; set; } + public string TemplateId { get; set; } = default!; /// /// 点击模板卡片后的跳转页面,仅限本小程序内的页面。 /// 支持带参数,(示例index?foo=bar)。 /// 该字段不填则模板无跳转 /// [JsonProperty("page")] - public string Page { get; set; } + public string? Page { get; set; } /// /// 跳转小程序类型: /// developer为开发版;trial为体验版;formal为正式版; /// 默认为正式版 /// [JsonProperty("miniprogram_state")] - public string MiniProgramState { get; set; } + public string? MiniProgramState { get; set; } /// /// 进入小程序查看”的语言类型, /// 支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文), /// 默认为zh_CN /// [JsonProperty("lang")] - public string Lang { get; set; } = "zh_CN"; + public string? Lang { get; set; } = "zh_CN"; /// /// 模板内容, /// 格式形如 { "key1": { "value": any }, "key2": { "value": any } } @@ -47,9 +47,9 @@ public class SubscribeMessage public SubscribeMessage( string openId, string templateId, - string redirectPage = "", - string state = "formal", - string miniLang = "zh_CN") + string? redirectPage = "", + string? state = "formal", + string? miniLang = "zh_CN") { ToUser = openId; TemplateId = templateId; @@ -72,22 +72,28 @@ public class SubscribeMessage return this; } - public SubscribeMessage WriteData(string prefix, IDictionary setData) + public SubscribeMessage WriteData(string prefix, IDictionary? setData) { - foreach (var kv in setData) + if (setData != null) { - WriteData(prefix, kv.Key, kv.Value); - } + foreach (var kv in setData) + { + WriteData(prefix, kv.Key, kv.Value ?? ""); + } + } return this; } - public SubscribeMessage WriteData(IDictionary setData) + public SubscribeMessage WriteData(IDictionary? setData) { - foreach (var kv in setData) + if (setData != null) { - if (!Data.ContainsKey(kv.Key)) + foreach (var kv in setData) { - Data.Add(kv.Key, new MessageData(kv.Value)); + if (!Data.ContainsKey(kv.Key)) + { + Data.Add(kv.Key, new MessageData(kv.Value ?? "")); + } } } return this; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessager.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessager.cs index 4748c2d4a..1c23c500c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessager.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessager.cs @@ -48,10 +48,10 @@ public class SubscribeMessager : ISubscribeMessager, ITransientDependency public async virtual Task SendAsync( Guid toUser, string templateId, - string page = "", - string lang = "zh_CN", - string state = "formal", - Dictionary data = null, + string? page = "", + string? lang = "zh_CN", + string? state = "formal", + Dictionary? data = null, CancellationToken cancellation = default) { var openId = await UserWeChatOpenIdFinder.FindByUserIdAsync(toUser, AbpWeChatMiniProgramConsts.ProviderName); @@ -87,7 +87,7 @@ public class SubscribeMessager : ISubscribeMessager, ITransientDependency var weChatSendNotificationPath = "/cgi-bin/message/subscribe/send"; var requestUrl = BuildRequestUrl(weChatSendNotificationUrl, weChatSendNotificationPath, requestParamters); var responseContent = await MakeRequestAndGetResultAsync(requestUrl, message, cancellationToken); - var response = JsonConvert.DeserializeObject(responseContent); + var response = JsonConvert.DeserializeObject(responseContent)!; if (!response.IsSuccessed) { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Message/Dto/MessageHandleInput.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Message/Dto/MessageHandleInput.cs index dd36e61f2..6e06e84cf 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Message/Dto/MessageHandleInput.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Message/Dto/MessageHandleInput.cs @@ -1,5 +1,6 @@ using LINGYUN.Abp.WeChat.Official.Models; using System; +using System.ComponentModel.DataAnnotations; using Volo.Abp.Auditing; namespace LINGYUN.Abp.WeChat.Official.Message; @@ -7,6 +8,7 @@ namespace LINGYUN.Abp.WeChat.Official.Message; [Serializable] public class MessageHandleInput : WeChatMessage { + [Required] [DisableAuditing] - public string Data { get; set; } + public string Data { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Message/Dto/MessageValidationInput.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Message/Dto/MessageValidationInput.cs index 0929bf76b..1376a6061 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Message/Dto/MessageValidationInput.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Message/Dto/MessageValidationInput.cs @@ -8,5 +8,5 @@ public class MessageValidationInput : WeChatMessage /// 加密的字符串。需要解密得到消息内容明文,解密后有random、msg_len、msg、receiveid四个字段,其中msg即为消息内容明文 /// [JsonPropertyName("echostr")] - public string EchoStr { get; set; } + public string EchoStr { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Models/WeChatMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Models/WeChatMessage.cs index 150abf143..8b00c0aea 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Models/WeChatMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN/Abp/WeChat/Official/Models/WeChatMessage.cs @@ -11,7 +11,7 @@ public class WeChatMessage /// 签名计算方法参考: https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Before_Develop/Message_encryption_and_decryption.html /// [JsonPropertyName("signature")] - public string Signature { get; set; } + public string Signature { get; set; } = default!; /// /// 时间戳。与nonce结合使用,用于防止请求重放攻击。 /// @@ -21,5 +21,5 @@ public class WeChatMessage /// 随机数。与timestamp结合使用,用于防止请求重放攻击。 /// [JsonPropertyName("nonce")] - public string Nonce { get; set; } + public string Nonce { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptions.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptions.cs index 1c4a5ea0f..e7ca707d4 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptions.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptions.cs @@ -12,21 +12,21 @@ public class AbpWeChatOfficialOptions /// /// 公众号服务器消息Url /// - public string Url { get; set; } + public string Url { get; set; } = default!; /// /// 公众号AppId /// - public string AppId { get; set; } + public string AppId { get; set; } = default!; /// /// 公众号AppSecret /// - public string AppSecret { get; set; } + public string AppSecret { get; set; } = default!; /// /// 公众号消息解密Token /// - public string Token { get; set; } + public string Token { get; set; } = default!; /// /// 公众号消息解密AESKey /// - public string EncodingAESKey { get; set; } + public string EncodingAESKey { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/CreateTicketModel.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/CreateTicketModel.cs index b5b5e3535..d6b5c6805 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/CreateTicketModel.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/CreateTicketModel.cs @@ -23,13 +23,13 @@ public class CreateTicketModel : WeChatRequest /// [JsonProperty("action_name")] [JsonPropertyName("action_name")] - public string ActionName { get; private set; } + public string ActionName { get; private set; } = default!; /// /// 二维码详细信息 /// [JsonProperty("action_info")] [JsonPropertyName("action_info")] - public Scene SceneInfo { get; private set; } + public Scene SceneInfo { get; private set; } = default!; private CreateTicketModel() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/TicketModel.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/TicketModel.cs index 013c15a25..e0eaeacd3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/TicketModel.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/TicketModel.cs @@ -9,7 +9,7 @@ public class TicketModel /// [JsonProperty("ticket")] [JsonPropertyName("ticket")] - public string Ticket { get; set; } + public string Ticket { get; set; } = default!; /// /// 该二维码有效时间,以秒为单位。 最大不超过2592000(即30天)。 /// @@ -21,5 +21,5 @@ public class TicketModel /// [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string Url { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/TicketModelCacheItem.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/TicketModelCacheItem.cs index 218ee5569..1a9a74487 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/TicketModelCacheItem.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/Models/TicketModelCacheItem.cs @@ -1,11 +1,11 @@ namespace LINGYUN.Abp.WeChat.Official.Account.Models; public class TicketModelCacheItem { - public string Ticket { get; set; } + public string Ticket { get; set; } = default!; public int ExpireSeconds { get; set; } - public string Url { get; set; } + public string Url { get; set; } = default!; public TicketModelCacheItem() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/ParametricQrCodeGenerator.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/ParametricQrCodeGenerator.cs index 4027c388b..2a62cb1c8 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/ParametricQrCodeGenerator.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Account/ParametricQrCodeGenerator.cs @@ -70,7 +70,7 @@ public class ParametricQrCodeGenerator : IParametricQrCodeGenerator, ITransientD response.ThrowNotSuccessStatusCode(); var responseContent = await response.Content.ReadAsStringAsync(); - var ticketModel = JsonConvert.DeserializeObject(responseContent); + var ticketModel = JsonConvert.DeserializeObject(responseContent)!; cacheItem = new TicketModelCacheItem(ticketModel.Ticket, ticketModel.ExpireSeconds, ticketModel.Url); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatureDefinitionProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatureDefinitionProvider.cs index e918233c4..eeeb49e34 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatureDefinitionProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatureDefinitionProvider.cs @@ -12,7 +12,7 @@ public class WeChatOfficialFeatureDefinitionProvider : FeatureDefinitionProvider { var group = context.GetGroupOrNull(WeChatFeatures.GroupName); - var officialEnableFeature = group.AddFeature( + var officialEnableFeature = group?.AddFeature( name: WeChatOfficialFeatures.Enable, defaultValue: true.ToString(), displayName: L("Features:WeChat.Official.Enable"), diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/CustomMenuEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/CustomMenuEvent.cs index 773e2ffcf..1e1d26e30 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/CustomMenuEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/CustomMenuEvent.cs @@ -13,7 +13,7 @@ public class CustomMenuEvent : WeChatEventMessage /// 事件KEY值 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/GeoLocationMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/GeoLocationMessage.cs index 1179993da..e7616ce6f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/GeoLocationMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/GeoLocationMessage.cs @@ -28,7 +28,7 @@ public class GeoLocationMessage : WeChatOfficialGeneralMessage /// 地理位置信息 /// [XmlElement("Label")] - public string Label { get; set; } + public string Label { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatOfficialGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/LinkMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/LinkMessage.cs index 1c4423295..e4f4aded5 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/LinkMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/LinkMessage.cs @@ -13,17 +13,17 @@ public class LinkMessage : WeChatOfficialGeneralMessage /// 消息标题 /// [XmlElement("Title")] - public string Title { get; set; } + public string Title { get; set; } = default!; /// /// 消息描述 /// [XmlElement("Description")] - public string Description { get; set; } + public string? Description { get; set; } /// /// 消息链接 /// [XmlElement("Url")] - public string Url { get; set; } + public string Url { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatOfficialGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/MenuClickJumpLinkEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/MenuClickJumpLinkEvent.cs index 487e4fb65..e47f3696a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/MenuClickJumpLinkEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/MenuClickJumpLinkEvent.cs @@ -13,7 +13,7 @@ public class MenuClickJumpLinkEvent : WeChatEventMessage /// 事件KEY值 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatOfficialEventMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/ParametricQrCodeEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/ParametricQrCodeEvent.cs index 696ed977c..c2b6b90a2 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/ParametricQrCodeEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/ParametricQrCodeEvent.cs @@ -13,12 +13,12 @@ public class ParametricQrCodeEvent : WeChatEventMessage /// 事件KEY值 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; /// /// 二维码的ticket,可用来换取二维码图片 /// [XmlElement("Ticket")] - public string Ticket { get; set; } + public string Ticket { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatOfficialEventMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/PictureMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/PictureMessage.cs index 13a06cde9..e7316c689 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/PictureMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/PictureMessage.cs @@ -13,12 +13,12 @@ public class PictureMessage : WeChatOfficialGeneralMessage /// 图片链接(由系统生成) /// [XmlElement("PicUrl")] - public string PicUrl { get; set; } + public string PicUrl { get; set; } = default!; /// /// 图片消息媒体id,可以调用获取临时素材接口拉取数据。 /// [XmlElement("MediaId")] - public string MediaId { get; set; } + public string MediaId { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatOfficialGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/TextMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/TextMessage.cs index f9e495433..7a225180a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/TextMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/TextMessage.cs @@ -13,7 +13,7 @@ public class TextMessage : WeChatOfficialGeneralMessage /// 文本消息内容 /// [XmlElement("Content")] - public string Content { get; set; } + public string Content { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatOfficialGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/VideoMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/VideoMessage.cs index bfd211376..5e51dd260 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/VideoMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/VideoMessage.cs @@ -13,12 +13,12 @@ public class VideoMessage : WeChatOfficialGeneralMessage /// 视频消息缩略图的媒体id,可以调用多媒体文件下载接口拉取数据。 /// [XmlElement("ThumbMediaId")] - public string ThumbMediaId { get; set; } + public string ThumbMediaId { get; set; } = default!; /// /// 视频消息媒体id,可以调用获取临时素材接口拉取数据。 /// [XmlElement("MediaId")] - public string MediaId { get; set; } + public string MediaId { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatOfficialGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/VoiceMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/VoiceMessage.cs index 2f8990c53..5353eb26a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/VoiceMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/Models/VoiceMessage.cs @@ -13,7 +13,7 @@ public class VoiceMessage : WeChatOfficialGeneralMessage /// 语音格式,如amr,speex等 /// [XmlElement("Format")] - public string Format { get; set; } + public string Format { get; set; } = default!; /// /// 语音识别结果,UTF8编码 /// @@ -22,12 +22,12 @@ public class VoiceMessage : WeChatOfficialGeneralMessage /// 注:由于客户端缓存,开发者开启或者关闭语音识别功能,对新关注者立刻生效,对已关注用户需要24小时生效。开发者可以重新关注此账号进行测试)。 /// [XmlElement("Recognition")] - public string Recognition { get; set; } + public string Recognition { get; set; } = default!; /// /// 语音消息媒体id,可以调用获取临时素材接口拉取该媒体 /// [XmlElement("MediaId")] - public string MediaId { get; set; } + public string MediaId { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatOfficialGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialEventMessageEto.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialEventMessageEto.cs index 6dd84a18f..1ff23080e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialEventMessageEto.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialEventMessageEto.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.WeChat.Official.Messages; public class WeChatOfficialEventMessageEto : WeChatMessageEto where TEvent : WeChatEventMessage { - public TEvent Event { get; set; } + public TEvent Event { get; set; } = default!; public WeChatOfficialEventMessageEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialGeneralMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialGeneralMessage.cs index 0979fa034..f7d95c81c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialGeneralMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialGeneralMessage.cs @@ -8,10 +8,10 @@ public abstract class WeChatOfficialGeneralMessage : WeChatGeneralMessage /// 消息的数据ID(消息如果来自文章时才有) /// [XmlElement("MsgDataId")] - public string MsgDataId { get; set; } + public string? MsgDataId { get; set; } /// /// 多图文时第几篇文章,从1开始(消息如果来自文章时才有) /// [XmlElement("Idx")] - public string Idx { get; set; } + public string? Idx { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialGeneralMessageEto.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialGeneralMessageEto.cs index c27cc00af..e451e43fc 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialGeneralMessageEto.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialGeneralMessageEto.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.WeChat.Official.Messages; public class WeChatOfficialGeneralMessageEto : WeChatMessageEto where TMessage : WeChatOfficialGeneralMessage { - public TMessage Message { get; set; } + public TMessage Message { get; set; } = default!; public WeChatOfficialGeneralMessageEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialMessageResolveContributor.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialMessageResolveContributor.cs index da22ec390..497f2f31a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialMessageResolveContributor.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Messages/WeChatOfficialMessageResolveContributor.cs @@ -1,4 +1,5 @@ using LINGYUN.Abp.WeChat.Common.Messages; +using System; using System.Threading.Tasks; namespace LINGYUN.Abp.WeChat.Official.Messages; @@ -12,7 +13,8 @@ public class WeChatOfficialMessageResolveContributor : WeChatOfficialMessageReso protected override Task ResolveMessageAsync(IMessageResolveContext context, AbpWeChatOfficialMessageResolveOptions options) { var messageType = context.GetMessageData("MsgType"); - if (options.MessageMaps.TryGetValue(messageType, out var messageFactory)) + if (!messageType.IsNullOrWhiteSpace() && + options.MessageMaps.TryGetValue(messageType, out var messageFactory)) { context.Message = messageFactory(context); context.Handled = true; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Services/Models/MessageModel.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Services/Models/MessageModel.cs index e6f768c21..433ae9df5 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Services/Models/MessageModel.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Services/Models/MessageModel.cs @@ -9,7 +9,7 @@ public abstract class MessageModel : WeChatRequest /// [JsonProperty("msgtype")] [JsonPropertyName("msgtype")] - public string MsgType { get; } + public string MsgType { get; } = default!; protected MessageModel(string msgType) { MsgType = msgType; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs index 09feed778..57c3c298f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs @@ -47,7 +47,7 @@ public class WeChatSettingAppService : ApplicationService, IWeChatSettingAppServ return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); } - protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + protected async virtual Task GetAllForProviderAsync(string providerName, string? providerKey = null) { var settingGroups = new SettingGroupResult(); var wechatSettingGroup = new SettingGroupDto(L["DisplayName:WeChat"], L["Description:WeChat"]); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/JsSdk/Dtos/AgentConfigDto.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/JsSdk/Dtos/AgentConfigDto.cs index 4ce84bffb..3cc20a721 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/JsSdk/Dtos/AgentConfigDto.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/JsSdk/Dtos/AgentConfigDto.cs @@ -3,4 +3,9 @@ public class AgentConfigDto { public string AgentId { get; set; } public string CorpId { get; set; } + public AgentConfigDto(string agentId, string corpId) + { + AgentId = agentId; + CorpId = corpId; + } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/JsSdk/Dtos/JsApiSignatureDto.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/JsSdk/Dtos/JsApiSignatureDto.cs index 67d321223..160d56722 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/JsSdk/Dtos/JsApiSignatureDto.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/JsSdk/Dtos/JsApiSignatureDto.cs @@ -4,10 +4,6 @@ public class JsApiSignatureDto public string Nonce { get; set; } public string Timestamp { get; set; } public string Signature { get; set; } - public JsApiSignatureDto() - { - - } public JsApiSignatureDto(string nonce, string timestamp, string signature) { Nonce = nonce; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Message/Dto/MessageHandleInput.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Message/Dto/MessageHandleInput.cs index ee16fa81b..10fc69b44 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Message/Dto/MessageHandleInput.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Message/Dto/MessageHandleInput.cs @@ -1,5 +1,6 @@ using LINGYUN.Abp.WeChat.Work.Models; using System; +using System.ComponentModel.DataAnnotations; using Volo.Abp.Auditing; namespace LINGYUN.Abp.WeChat.Work.Message; @@ -7,6 +8,7 @@ namespace LINGYUN.Abp.WeChat.Work.Message; [Serializable] public class MessageHandleInput : WeChatWorkMessage { + [Required] [DisableAuditing] - public string Data { get; set; } + public string Data { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Message/Dto/MessageValidationInput.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Message/Dto/MessageValidationInput.cs index 0a00b1b71..aae5452dc 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Message/Dto/MessageValidationInput.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Message/Dto/MessageValidationInput.cs @@ -1,4 +1,5 @@ using LINGYUN.Abp.WeChat.Work.Models; +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace LINGYUN.Abp.WeChat.Work.Message; @@ -7,6 +8,7 @@ public class MessageValidationInput : WeChatWorkMessage /// /// 加密的字符串。需要解密得到消息内容明文,解密后有random、msg_len、msg、receiveid四个字段,其中msg即为消息内容明文 /// + [Required] [JsonPropertyName("echostr")] - public string EchoStr { get; set; } + public string EchoStr { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Models/WeChatWorkMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Models/WeChatWorkMessage.cs index fa13e322a..08fc490d1 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Models/WeChatWorkMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN/Abp/WeChat/Work/Models/WeChatWorkMessage.cs @@ -1,4 +1,5 @@ -using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; namespace LINGYUN.Abp.WeChat.Work.Models; public class WeChatWorkMessage @@ -10,16 +11,19 @@ public class WeChatWorkMessage /// /// 签名计算方法参考: https://developer.work.weixin.qq.com/document/path/90930#12976/%E6%B6%88%E6%81%AF%E4%BD%93%E7%AD%BE%E5%90%8D%E6%A0%A1%E9%AA%8C /// + [Required] [JsonPropertyName("msg_signature")] - public string Msg_Signature { get; set; } + public string MsgSignature { get; set; } = default!; /// /// 时间戳。与nonce结合使用,用于防止请求重放攻击。 /// + [Required] [JsonPropertyName("timestamp")] public int TimeStamp { get; set; } /// /// 随机数。与timestamp结合使用,用于防止请求重放攻击。 /// + [Required] [JsonPropertyName("nonce")] - public string Nonce { get; set; } + public string Nonce { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/Authorize/WeChatWorkAuthorizeAppService.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/Authorize/WeChatWorkAuthorizeAppService.cs index 13ab2f28a..77b3b84b0 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/Authorize/WeChatWorkAuthorizeAppService.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/Authorize/WeChatWorkAuthorizeAppService.cs @@ -33,7 +33,7 @@ public class WeChatWorkAuthorizeAppService : ApplicationService, IWeChatWorkAuth var state = _encryptionService.Encrypt(userId); var redirectUri = await _appUrlProvider.GetUrlAsync(AbpWeChatWorkGlobalConsts.ProviderName, urlName); - return await _authorizeGenerator.GenerateOAuth2AuthorizeAsync(redirectUri, state, responseType, scope); + return await _authorizeGenerator.GenerateOAuth2AuthorizeAsync(redirectUri, state!, responseType, scope); } public async virtual Task GenerateOAuth2LoginAsync( @@ -44,6 +44,6 @@ public class WeChatWorkAuthorizeAppService : ApplicationService, IWeChatWorkAuth var state = _encryptionService.Encrypt(userId); var redirectUri = await _appUrlProvider.GetUrlAsync(AbpWeChatWorkGlobalConsts.ProviderName, urlName); - return await _authorizeGenerator.GenerateOAuth2LoginAsync(redirectUri, state, loginType); + return await _authorizeGenerator.GenerateOAuth2LoginAsync(redirectUri, state!, loginType); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/JsSdk/WeChatWorkJsSdkAppService.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/JsSdk/WeChatWorkJsSdkAppService.cs index 803c17395..14dec78ae 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/JsSdk/WeChatWorkJsSdkAppService.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/JsSdk/WeChatWorkJsSdkAppService.cs @@ -4,6 +4,7 @@ using LINGYUN.Abp.WeChat.Work.Settings; using Microsoft.AspNetCore.Authorization; using System.Threading.Tasks; using System.Web; +using Volo.Abp; using Volo.Abp.Application.Services; using Volo.Abp.Features; @@ -25,11 +26,7 @@ public class WeChatWorkJsSdkAppService : ApplicationService, IWeChatWorkJsSdkApp var corpId = await SettingProvider.GetOrNullAsync(WeChatWorkSettingNames.Connection.CorpId); var agentId = await SettingProvider.GetOrNullAsync(WeChatWorkSettingNames.Connection.AgentId); - return new AgentConfigDto - { - CorpId = corpId, - AgentId = agentId, - }; + return new AgentConfigDto(corpId ?? "", agentId ?? ""); } public async virtual Task GetAgentSignatureAsync(string url) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/Message/WeChatWorkMessageAppService.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/Message/WeChatWorkMessageAppService.cs index 4c880252d..04920b088 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/Message/WeChatWorkMessageAppService.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN/Abp/WeChat/Work/Message/WeChatWorkMessageAppService.cs @@ -48,7 +48,7 @@ public class WeChatWorkMessageAppService : ApplicationService, IWeChatWorkMessag corpId, token, aesKey, - input.Msg_Signature, + input.MsgSignature, input.TimeStamp.ToString(), input.Nonce); @@ -78,7 +78,7 @@ public class WeChatWorkMessageAppService : ApplicationService, IWeChatWorkMessag corpId, token, aesKey, - input.Msg_Signature, + input.MsgSignature, input.TimeStamp, input.Nonce, input.Data); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.AspNetCore/Microsoft/AspNetCore/Authentication/WeChat/Work/WeChatWorkOAuthHandler.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.AspNetCore/Microsoft/AspNetCore/Authentication/WeChat/Work/WeChatWorkOAuthHandler.cs index 2d4a609c0..e6e694a6c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.AspNetCore/Microsoft/AspNetCore/Authentication/WeChat/Work/WeChatWorkOAuthHandler.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.AspNetCore/Microsoft/AspNetCore/Authentication/WeChat/Work/WeChatWorkOAuthHandler.cs @@ -57,9 +57,9 @@ public class WeChatWorkOAuthHandler : OAuthHandler // Check.NotNullOrEmpty(secret, nameof(secret)); // 用配置项重写 - Options.CorpId = corpId; - Options.ClientId = agentId; - Options.ClientSecret = secret; + Options.CorpId = corpId ?? ""; + Options.ClientId = agentId ?? ""; + Options.ClientSecret = secret ?? ""; Options.TimeProvider ??= TimeProvider.System; @@ -81,7 +81,7 @@ public class WeChatWorkOAuthHandler : OAuthHandler ? WeChatWorkOAuthConsts.AuthorizationEndpoint : WeChatWorkOAuthConsts.AuthorizationSsoEndpoint; - var parameters = new Dictionary + var parameters = new Dictionary { { "appid", Options.CorpId }, { "redirect_uri", redirectUri }, @@ -103,7 +103,7 @@ public class WeChatWorkOAuthHandler : OAuthHandler /// protected async override Task ExchangeCodeAsync(OAuthCodeExchangeContext context) { - var parameters = new Dictionary() + var parameters = new Dictionary() { { "corpid", Options.CorpId }, { "corpsecret", Options.ClientSecret }, @@ -151,7 +151,7 @@ public class WeChatWorkOAuthHandler : OAuthHandler ? WeChatWorkOAuthConsts.UserDetailEndpoint : WeChatWorkOAuthConsts.UserInfoEndpoint; - var address = QueryHelpers.AddQueryString(userInfoEndpoint, new Dictionary + var address = QueryHelpers.AddQueryString(userInfoEndpoint, new Dictionary { ["access_token"] = tokens.AccessToken, ["code"] = code @@ -195,7 +195,7 @@ public class WeChatWorkOAuthHandler : OAuthHandler await Events.CreatingTicket(context); - return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name); + return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name); } protected async override Task HandleRemoteAuthenticateAsync() @@ -268,7 +268,7 @@ public class WeChatWorkOAuthHandler : OAuthHandler return HandleRequestResult.Fail("Code was not found.", properties); } - var codeExchangeContext = new OAuthCodeExchangeContext(properties, code, BuildRedirectUri(Options.CallbackPath)); + var codeExchangeContext = new OAuthCodeExchangeContext(properties, code!, BuildRedirectUri(Options.CallbackPath)); using var tokens = await ExchangeCodeAsync(codeExchangeContext); if (tokens.Error != null) @@ -305,7 +305,7 @@ public class WeChatWorkOAuthHandler : OAuthHandler { // https://www.w3.org/TR/xmlschema-2/#dateTime // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - var expiresAt = Options.TimeProvider.GetUtcNow() + TimeSpan.FromSeconds(value); + var expiresAt = Options.TimeProvider!.GetUtcNow() + TimeSpan.FromSeconds(value); authTokens.Add(new AuthenticationToken { Name = "expires_at", @@ -317,7 +317,7 @@ public class WeChatWorkOAuthHandler : OAuthHandler properties.StoreTokens(authTokens); } - var ticket = await CreateTicketAsync(code, identity, properties, tokens); + var ticket = await CreateTicketAsync(code!, identity, properties, tokens); if (ticket != null) { return HandleRequestResult.Success(ticket); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.AspNetCore/System/Text/Json/JsonElementExtensions.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.AspNetCore/System/Text/Json/JsonElementExtensions.cs index 653a868ac..2ac348249 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.AspNetCore/System/Text/Json/JsonElementExtensions.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.AspNetCore/System/Text/Json/JsonElementExtensions.cs @@ -13,11 +13,11 @@ namespace System.Text.Json { var result = new List(); - if (json.TryGetProperty(key, out JsonElement property) && property.ValueKind == JsonValueKind.Array) + if (json.TryGetProperty(key, out var property) && property.ValueKind == JsonValueKind.Array) { foreach (var jsonProp in property.EnumerateArray()) { - result.Add(jsonProp.GetString()); + result.Add(jsonProp.GetString()!); } } @@ -26,25 +26,25 @@ namespace System.Text.Json public static string GetRootString(this JsonDocument json, string key, string defaultValue = "") { - if (json.RootElement.TryGetProperty(key, out JsonElement property)) + if (json.RootElement.TryGetProperty(key, out var property)) { - return property.GetString(); + return property.GetString() ?? defaultValue; } return defaultValue; } public static string GetString(this JsonElement json, string key, string defaultValue = "") { - if (json.TryGetProperty(key, out JsonElement property)) + if (json.TryGetProperty(key, out var property)) { - return property.GetString(); + return property.GetString() ?? defaultValue; } return defaultValue; } public static int GetRootInt32(this JsonDocument json, string key, int defaultValue = 0) { - if (json.RootElement.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value)) + if (json.RootElement.TryGetProperty(key, out var property) && property.TryGetInt32(out int value)) { return value; } @@ -53,7 +53,7 @@ namespace System.Text.Json public static int GetInt32(this JsonElement json, string key, int defaultValue = 0) { - if (json.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value)) + if (json.TryGetProperty(key, out var property) && property.TryGetInt32(out int value)) { return value; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalAttribute.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalAttribute.cs index 9c3ec674b..0b410962a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalAttribute.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalAttribute.cs @@ -14,7 +14,7 @@ public abstract class ExternalAttribute [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 属性类型 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalMiniProgramAttribute.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalMiniProgramAttribute.cs index 203b3cd9c..436e54db4 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalMiniProgramAttribute.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalMiniProgramAttribute.cs @@ -14,7 +14,7 @@ public class ExternalMiniProgramAttribute : ExternalAttribute [NotNull] [JsonProperty("miniprogram")] [JsonPropertyName("miniprogram")] - public ExternalMiniProgramModel MiniProgram { get; set; } + public ExternalMiniProgramModel MiniProgram { get; set; } = default!; } public class ExternalMiniProgramModel @@ -25,19 +25,19 @@ public class ExternalMiniProgramModel [NotNull] [JsonProperty("appid")] [JsonPropertyName("appid")] - public string AppId { get; set; } + public string AppId { get; set; } = default!; /// /// 小程序的展示标题,长度限制12个UTF8字符 /// [NotNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string Title { get; set; } = default!; /// /// 小程序的页面路径 /// [NotNull] [JsonProperty("pagepath")] [JsonPropertyName("pagepath")] - public string PagePath { get; set; } + public string PagePath { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalProfile.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalProfile.cs index 09771e8a1..2a394613b 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalProfile.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalProfile.cs @@ -17,7 +17,7 @@ public class ExternalProfile [NotNull] [JsonProperty("external_corp_name")] [JsonPropertyName("external_corp_name")] - public string ExternalCorpName { get; set; } + public string ExternalCorpName { get; set; } = default!; /// /// 视频号属性。须从企业绑定到企业微信的视频号中选择,可在“我的企业”页中查看绑定的视频号。 /// 第三方仅通讯录应用可获取;对于非第三方创建的成员,第三方通讯录应用也不可获取 @@ -25,12 +25,12 @@ public class ExternalProfile [NotNull] [JsonProperty("wechat_channels")] [JsonPropertyName("wechat_channels")] - public List WechatChannels { get; set; } + public List WechatChannels { get; set; } = default!; /// /// 属性列表 /// [NotNull] [JsonProperty("external_attr")] [JsonPropertyName("external_attr")] - public List ExternalAttributes { get; set; } + public List ExternalAttributes { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalTextAttribute.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalTextAttribute.cs index 71f9ad287..3c5804c88 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalTextAttribute.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalTextAttribute.cs @@ -14,7 +14,7 @@ public class ExternalTextAttribute : ExternalAttribute [NotNull] [JsonProperty("text")] [JsonPropertyName("text")] - public ExternalTextModel Text { get; set; } + public ExternalTextModel Text { get; set; } = default!; } public class ExternalTextModel @@ -25,5 +25,5 @@ public class ExternalTextModel [NotNull] [JsonProperty("value")] [JsonPropertyName("value")] - public string Value { get; set; } + public string Value { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalWebAttribute.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalWebAttribute.cs index b95b45d0d..b3a0d7cc6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalWebAttribute.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalWebAttribute.cs @@ -14,7 +14,7 @@ public class ExternalWebAttribute : ExternalAttribute [NotNull] [JsonProperty("web")] [JsonPropertyName("web")] - public ExternalWebModel Web { get; set; } + public ExternalWebModel Web { get; set; } = default!; } public class ExternalWebModel @@ -25,12 +25,12 @@ public class ExternalWebModel [NotNull] [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string Url { get; set; } = default!; /// /// 网页的展示标题,长度限制12个UTF8字符 /// [NotNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string Title { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/MemberExtendAttribute.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/MemberExtendAttribute.cs index d76dbd70e..446f76692 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/MemberExtendAttribute.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/MemberExtendAttribute.cs @@ -10,7 +10,7 @@ public class MemberExtendAttribute /// 扩展属性 /// [XmlElement("Item")] - public List Items { get;set; } + public List? Items { get;set; } } public class MemberExtend @@ -24,17 +24,17 @@ public class MemberExtend /// 扩展属性名称 /// [XmlElement("Name")] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 文本属性内容 /// [XmlElement("Text", IsNullable = true)] - public MemberTextExtend Text { get; set; } + public MemberTextExtend? Text { get; set; } /// /// Web属性内容 /// [XmlElement("Web", IsNullable = true)] - public MemberWebExtend Web { get; set; } + public MemberWebExtend? Web { get; set; } } /// @@ -47,7 +47,7 @@ public class MemberTextExtend /// 文本属性内容 /// [XmlElement("Value")] - public string Value { get; set;} + public string Value { get; set; } = default!; } /// /// 网页类型属性,扩展属性类型为1时填写 @@ -59,10 +59,10 @@ public class MemberWebExtend /// 网页的展示标题 /// [XmlElement("Title")] - public string Title { get; set; } + public string Title { get; set; } = default!; /// /// 网页的url /// [XmlElement("Url")] - public string Url { get; set; } + public string Url { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/WechatChannel.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/WechatChannel.cs index 41d013c36..b089e7750 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/WechatChannel.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/WechatChannel.cs @@ -14,7 +14,7 @@ public class WechatChannel [NotNull] [JsonProperty("nickname")] [JsonPropertyName("nickname")] - public string NickName { get; set; } + public string NickName { get; set; } = default!; /// /// 对外展示视频号状态 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ApprovalStatusChangeEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ApprovalStatusChangeEvent.cs index 6998e86f9..84b57894b 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ApprovalStatusChangeEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ApprovalStatusChangeEvent.cs @@ -14,12 +14,12 @@ public class ApprovalStatusChangeEvent : WeChatWorkEventMessage /// 事件KEY值 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; /// /// 审批信息 /// [XmlElement("ApprovalInfo")] - public ApprovalInfo ApprovalInfo { get; set; } + public ApprovalInfo ApprovalInfo { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatWorkEventMessageEto(this); @@ -32,17 +32,17 @@ public class ApprovalInfo /// 审批单编号,由开发者在发起申请时自定义 /// [XmlElement("ThirdNo")] - public string ThirdNo { get; set; } + public string ThirdNo { get; set; } = default!; /// /// 审批模板名称 /// [XmlElement("OpenSpName")] - public string OpenSpName { get; set; } + public string OpenSpName { get; set; } = default!; /// /// 审批模板id /// [XmlElement("OpenTemplateId")] - public string OpenTemplateId { get; set; } + public string OpenTemplateId { get; set; } = default!; /// /// 申请单当前审批状态: /// 1-审批中; @@ -61,32 +61,32 @@ public class ApprovalInfo /// 提交者姓名 /// [XmlElement("ApplyUserName")] - public string ApplyUserName { get; set; } + public string ApplyUserName { get; set; } = default!; /// /// 提交者userid /// [XmlElement("ApplyUserId")] - public string ApplyUserId { get; set; } + public string ApplyUserId { get; set; } = default!; /// /// 提交者所在部门 /// [XmlElement("ApplyUserParty")] - public string ApplyUserParty { get; set; } + public string? ApplyUserParty { get; set; } /// /// 提交者头像 /// [XmlElement("ApplyUserImage")] - public string ApplyUserImage { get; set; } + public string? ApplyUserImage { get; set; } /// /// 审批流程信息 /// [XmlElement("ApprovalNodes")] - public List ApprovalNodes { get; set; } + public List ApprovalNodes { get; set; } = default!; /// /// 抄送信息,可能有多个抄送人 /// [XmlElement("NotifyNodes")] - public List NotifyNodes { get; set; } + public List? NotifyNodes { get; set; } /// /// 当前审批节点:0-第一个审批节点;1-第二个审批节点…以此类推 /// @@ -128,7 +128,7 @@ public class ApprovalNode /// 审批节点信息,当节点为标签或上级时,一个节点可能有多个分支 /// [XmlElement("Items")] - public List Items { get; set; } + public List Items { get; set; } = default!; } /// /// 审批节点分支,当节点为标签或上级时,一个节点可能有多个分支 @@ -140,17 +140,17 @@ public class ApprovalNodeItem /// 分支审批人姓名 /// [XmlElement("ItemName")] - public string ItemName { get; set; } + public string ItemName { get; set; } = default!; /// /// 分支审批人userid /// [XmlElement("ItemUserId")] - public string ItemUserId { get; set; } + public string ItemUserId { get; set; } = default!; /// /// 分支审批人头像 /// [XmlElement("ItemImage")] - public string ItemImage { get; set; } + public string? ItemImage { get; set; } /// /// 分支审批审批操作状态: /// 1-审批中; @@ -164,7 +164,7 @@ public class ApprovalNodeItem /// 分支审批人审批意见 /// [XmlElement("ItemSpeech")] - public string ItemSpeech { get; set; } + public string? ItemSpeech { get; set; } /// /// 分支审批人审批意见 /// @@ -181,15 +181,15 @@ public class NotifyNode /// 抄送人姓名 /// [XmlElement("ItemName")] - public string ItemName { get; set; } + public string ItemName { get; set; } = default!; /// /// 抄送人userid /// [XmlElement("ItemUserId")] - public string ItemUserId { get; set; } + public string ItemUserId { get; set; } = default!; /// /// 抄送人头像 /// [XmlElement("ItemImage")] - public string ItemImage { get; set; } + public string? ItemImage { get; set; } } \ No newline at end of file diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/CustomMenuPushEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/CustomMenuPushEvent.cs index 3814bb950..0d88c8051 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/CustomMenuPushEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/CustomMenuPushEvent.cs @@ -13,7 +13,7 @@ public class CustomMenuPushEvent : WeChatWorkEventMessage /// 事件KEY值 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/EnterAgentEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/EnterAgentEvent.cs index 6902e593a..7d4f547d0 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/EnterAgentEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/EnterAgentEvent.cs @@ -13,7 +13,7 @@ public class EnterAgentEvent : WeChatWorkEventMessage /// 事件KEY值 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatWorkEventMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/GeoLocationMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/GeoLocationMessage.cs index 8f19d4517..58a2d9bfb 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/GeoLocationMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/GeoLocationMessage.cs @@ -28,12 +28,12 @@ public class GeoLocationMessage : WeChatWorkGeneralMessage /// 地理位置信息 /// [XmlElement("Label")] - public string Label { get; set; } + public string? Label { get; set; } /// /// app类型,在企业微信固定返回wxwork,在微信不返回该字段 /// [XmlElement("AppType")] - public string AppType { get; set; } + public string? AppType { get; set; } public override WeChatMessageEto ToEto() { return new WeChatWorkGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/GeoLocationSelectPushEevent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/GeoLocationSelectPushEevent.cs index b95345bab..09a9361b7 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/GeoLocationSelectPushEevent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/GeoLocationSelectPushEevent.cs @@ -13,17 +13,17 @@ public class GeoLocationSelectPushEevent : WeChatWorkEventMessage /// 事件KEY值 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; /// /// 发送的位置信息 /// [XmlElement("SendLocationInfo")] - public LocationInfo SendLocationInfo { get; set; } + public LocationInfo SendLocationInfo { get; set; } = default!; /// /// app类型,在企业微信固定返回wxwork,在微信不返回该字段 /// [XmlElement("AppType")] - public string AppType { get; set; } + public string? AppType { get; set; } public override WeChatMessageEto ToEto() { @@ -52,10 +52,10 @@ public class LocationInfo /// 地理位置信息 /// [XmlElement("Label")] - public string Label { get; set; } + public string? Label { get; set; } /// /// POI的名字,可能为空 /// [XmlElement("Poiname")] - public string PoiName { get; set; } + public string? PoiName { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/LinkMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/LinkMessage.cs index d0af61f62..6a1774ab0 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/LinkMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/LinkMessage.cs @@ -13,17 +13,17 @@ public class LinkMessage : WeChatWorkGeneralMessage /// 消息标题 /// [XmlElement("Title")] - public string Title { get; set; } + public string Title { get; set; } = default!; /// /// 消息描述 /// [XmlElement("Description")] - public string Description { get; set; } + public string? Description { get; set; } /// /// 消息链接 /// [XmlElement("Url")] - public string Url { get; set; } + public string? Url { get; set; } public override WeChatMessageEto ToEto() { return new WeChatWorkGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/MenuClickJumpLinkPushEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/MenuClickJumpLinkPushEvent.cs index 66b2b1768..3954d8f30 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/MenuClickJumpLinkPushEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/MenuClickJumpLinkPushEvent.cs @@ -13,7 +13,7 @@ public class MenuClickJumpLinkPushEvent : WeChatWorkEventMessage /// 事件KEY值 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatWorkEventMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/PictureMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/PictureMessage.cs index dedcc371b..87de80426 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/PictureMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/PictureMessage.cs @@ -13,12 +13,12 @@ public class PictureMessage : WeChatWorkGeneralMessage /// 图片链接(由系统生成) /// [XmlElement("PicUrl")] - public string PicUrl { get; set; } + public string PicUrl { get; set; } = default!; /// /// 图片消息媒体id,可以调用获取临时素材接口拉取数据。 /// [XmlElement("MediaId")] - public string MediaId { get; set; } + public string MediaId { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatWorkGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/PicturePushEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/PicturePushEvent.cs index 836e59a86..77385fc27 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/PicturePushEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/PicturePushEvent.cs @@ -10,12 +10,12 @@ public abstract class PicturePushEvent : WeChatWorkEventMessage /// 事件KEY值 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; /// /// 事件KEY值 /// [XmlElement("SendPicsInfo")] - public PictureInfo SendPicsInfo { get; set; } + public PictureInfo SendPicsInfo { get; set; } = default!; } public class PictureInfo @@ -29,7 +29,7 @@ public class PictureInfo /// 发送的图片数量 /// [XmlArrayItem("Item")] - public Picture Picture { get; set; } + public Picture? Picture { get; set; } } [XmlRoot("PicList")] @@ -39,5 +39,5 @@ public class Picture /// 图片的MD5值,开发者若需要,可用于验证接收到图片 /// [XmlElement("PicMd5Sum")] - public string PicMd5Sum { get; set; } + public string PicMd5Sum { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ReportingGeoLocationEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ReportingGeoLocationEvent.cs index e61abcf0f..bd999d001 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ReportingGeoLocationEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ReportingGeoLocationEvent.cs @@ -28,7 +28,7 @@ public class ReportingGeoLocationEvent : WeChatWorkEventMessage /// app类型,在企业微信固定返回wxwork,在微信不返回该字段 /// [XmlElement("AppType")] - public string AppType { get; set; } + public string? AppType { get; set; } public override WeChatMessageEto ToEto() { return new WeChatWorkEventMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ScanCodeEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ScanCodeEvent.cs index 131b36cad..02fe88ce0 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ScanCodeEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/ScanCodeEvent.cs @@ -10,12 +10,12 @@ public abstract class ScanCodeEvent : WeChatWorkEventMessage /// 事件KEY值 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; /// /// 扫描信息 /// [XmlElement("ScanCodeInfo")] - public ScanCodeInfo ScanCodeInfo { get; set; } + public ScanCodeInfo ScanCodeInfo { get; set; } = default!; } public class ScanCodeInfo @@ -24,10 +24,10 @@ public class ScanCodeInfo /// 扫描类型,一般是qrcode /// [XmlElement("ScanType")] - public string ScanType { get; set; } + public string ScanType { get; set; } = default!; /// /// 扫描结果,即二维码对应的字符串信息 /// [XmlElement("ScanResult")] - public string ScanResult { get; set; } + public string ScanResult { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/SysApprovalStatusChangeEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/SysApprovalStatusChangeEvent.cs index a08fa5988..8c7fe1143 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/SysApprovalStatusChangeEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/SysApprovalStatusChangeEvent.cs @@ -15,7 +15,7 @@ public class SysApprovalStatusChangeEvent : WeChatWorkEventMessage /// 审批信息 /// [XmlElement("ApprovalInfo")] - public SysApprovalInfo ApprovalInfo { get; set; } + public SysApprovalInfo ApprovalInfo { get; set; } = default!; public override WeChatMessageEto ToEto() { @@ -29,12 +29,12 @@ public class SysApprovalInfo /// 审批编号(字符串类型) /// [XmlElement("SpNoStr")] - public string SpNoStr { get; set; } + public string SpNoStr { get; set; } = default!; /// /// 审批申请类型名称(审批模板名称) /// [XmlElement("SpName")] - public string SpName { get; set; } + public string SpName { get; set; } = default!; /// /// 申请单状态:1-审批中;2-已通过;3-已驳回;4-已撤销;6-通过后撤销;7-已删除;10-已支付 /// @@ -44,7 +44,7 @@ public class SysApprovalInfo /// 审批模板id。可在“获取审批申请详情”、“审批状态变化回调通知”中获得,也可在审批模板的模板编辑页面链接中获得。 /// [XmlElement("TemplateId")] - public string TemplateId { get; set; } + public string TemplateId { get; set; } = default!; /// /// 审批申请提交时间,Unix时间戳 /// @@ -54,27 +54,27 @@ public class SysApprovalInfo /// 申请人信息 /// [XmlElement("Applyer")] - public SysApprovalApplyer Applyer { get; set; } + public SysApprovalApplyer Applyer { get; set; } = default!; /// /// 审批流程信息,可能有多个审批节点。 /// [XmlElement("SpRecord")] - public List SpRecord { get; set; } + public List? SpRecord { get; set; } /// /// 抄送信息,可能有多个抄送节点 /// [XmlElement("Notifyer")] - public List Notifyer { get; set; } + public List? Notifyer { get; set; } /// /// 审批申请备注信息,可能有多个备注节点 /// [XmlElement("Comments")] - public List Comments { get; set; } + public List? Comments { get; set; } /// /// 审批流程列表 /// [XmlElement("ProcessList")] - public List ProcessList { get; set; } + public List? ProcessList { get; set; } /// /// 审批申请状态变化类型:1-提单;2-同意;3-驳回;4-转审;5-催办;6-撤销;8-通过后撤销;10-添加备注;11-回退给指定审批人;12-添加审批人;13-加签并同意; 14-已办理; 15-已转交 /// @@ -88,7 +88,7 @@ public class SysApprovalInfo /// [XmlElement("SpNo")] [Obsolete("局校审批单不返回此字段,其他类型审批单会返回此字段,不推荐使用此字段")] - public string SpNo { get; set; } + public string? SpNo { get; set; } } public class SysApprovalApplyer @@ -97,12 +97,12 @@ public class SysApprovalApplyer /// 申请人userid /// [XmlElement("UserId")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 申请人所在部门pid /// [XmlElement("Party")] - public string Party { get; set; } + public string? Party { get; set; } } public class SysApprovalRecord @@ -121,7 +121,7 @@ public class SysApprovalRecord /// 节点审批方式:1-或签;2-会签 /// [XmlElement("Details")] - public List Details { get; set; } + public List? Details { get; set; } } public class SysApprovalRecordDetail @@ -130,12 +130,12 @@ public class SysApprovalRecordDetail /// 分支审批人 /// [XmlElement("Approver")] - public SysApprovalApplyer Approver { get; set; } + public SysApprovalApplyer Approver { get; set; } = default!; /// /// 审批意见字段 /// [XmlElement("Speech")] - public string Speech { get; set; } + public string? Speech { get; set; } /// /// 分支审批人审批状态:1-审批中;2-已同意;3-已驳回;4-已转审 /// @@ -150,7 +150,7 @@ public class SysApprovalRecordDetail /// 节点分支审批人审批意见附件,赋值为media_id具体使用请参考:文档-获取临时素材 /// [XmlElement("Attach")] - public string Attach { get; set; } + public string? Attach { get; set; } } public class SysApprovalNotifyer @@ -159,7 +159,7 @@ public class SysApprovalNotifyer /// 节点抄送人userid /// [XmlElement("UserId")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; } public class SysApprovalComment @@ -168,7 +168,7 @@ public class SysApprovalComment /// 备注人信息 /// [XmlElement("CommentUserInfo")] - public SysApprovalCommenter CommentUserInfo { get; set; } + public SysApprovalCommenter CommentUserInfo { get; set; } = default!; /// /// 备注提交时间 /// @@ -178,17 +178,17 @@ public class SysApprovalComment /// 备注文本内容 /// [XmlElement("CommentContent")] - public string CommentContent { get; set; } + public string? CommentContent { get; set; } /// /// 备注id /// [XmlElement("CommentId")] - public string CommentId { get; set; } + public string CommentId { get; set; } = default!; /// /// 备注意见附件,值是附件media_id /// [XmlElement("Attach")] - public string Attach { get; set; } + public string? Attach { get; set; } } public class SysApprovalCommenter @@ -197,7 +197,7 @@ public class SysApprovalCommenter /// 节点抄送人userid /// [XmlElement("UserId")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; } public class SysApprovalProcess @@ -206,7 +206,7 @@ public class SysApprovalProcess /// 流程节点 /// [XmlElement("NodeList")] - public List NodeList { get; set; } + public List? NodeList { get; set; } } public class SysApprovalProcessNode @@ -230,7 +230,7 @@ public class SysApprovalProcessNode /// 子节点列表 /// [XmlElement("SubNodeList")] - public List SubNodeList { get; set; } + public List? SubNodeList { get; set; } } public class SysApprovalProcessSubNode @@ -239,12 +239,12 @@ public class SysApprovalProcessSubNode /// 处理人信息 /// [XmlElement("UserInfo")] - public SysApprovalProcesser UserInfo { get; set; } + public SysApprovalProcesser UserInfo { get; set; } = default!; /// /// 审批/办理意见 /// [XmlElement("Speech")] - public string Speech { get; set; } + public string? Speech { get; set; } /// /// 子节点状态 1-审批中;2-同意;3-驳回;4-转审;11-退回给指定审批人;12-加签;13-同意并加签;14-办理;15-转交 /// @@ -259,7 +259,7 @@ public class SysApprovalProcessSubNode /// 备注意见附件,值是附件media_id /// [XmlElement("MediaIds")] - public string MediaIds { get; set; } + public string? MediaIds { get; set; } } public class SysApprovalProcesser @@ -268,5 +268,5 @@ public class SysApprovalProcesser /// 处理人userid /// [XmlElement("UserId")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; } \ No newline at end of file diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TemplateCardMenuPushEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TemplateCardMenuPushEvent.cs index 8d615e3ab..a5d339871 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TemplateCardMenuPushEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TemplateCardMenuPushEvent.cs @@ -13,7 +13,7 @@ public class TemplateCardMenuPushEvent : WeChatWorkEventMessage /// 与发送模板卡片消息时指定的task_id相同 /// [XmlElement("TaskId")] - public string TaskId { get; set; } + public string TaskId { get; set; } = default!; /// /// 通用模板卡片的类型, /// 类型有 @@ -23,17 +23,17 @@ public class TemplateCardMenuPushEvent : WeChatWorkEventMessage /// 三种 /// [XmlElement("CardType")] - public string CardType { get; set; } + public string CardType { get; set; } = default!; /// /// 用于调用更新卡片接口的ResponseCode /// [XmlElement("ResponseCode")] - public string ResponseCode { get; set; } + public string ResponseCode { get; set; } = default!; /// /// 与发送模板卡片右上角菜单的按钮key值相同 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatWorkEventMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TemplateCardPushEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TemplateCardPushEvent.cs index d12a93c1d..7c9360123 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TemplateCardPushEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TemplateCardPushEvent.cs @@ -14,7 +14,7 @@ public class TemplateCardPushEvent : WeChatWorkEventMessage /// 与发送模板卡片消息时指定的task_id相同 /// [XmlElement("TaskId")] - public string TaskId { get; set; } + public string TaskId { get; set; } = default!; /// /// 通用模板卡片的类型,类型有 /// "text_notice", @@ -25,22 +25,22 @@ public class TemplateCardPushEvent : WeChatWorkEventMessage /// 五种 /// [XmlElement("CardType")] - public string CardType { get; set; } + public string CardType { get; set; } = default!; /// /// 用于调用更新卡片接口的ResponseCode,72小时内有效,且只能使用一次 /// [XmlElement("ResponseCode")] - public string ResponseCode { get; set; } + public string ResponseCode { get; set; } = default!; /// /// 与发送模板卡片消息时指定的按钮btn:key值相同 /// [XmlElement("EventKey")] - public string EventKey { get; set; } + public string EventKey { get; set; } = default!; /// /// 事件KEY值 /// [XmlElement("SelectedItems")] - public TemplateCardQuestionInfo QuestionInfo { get; set; } + public TemplateCardQuestionInfo QuestionInfo { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatWorkEventMessageEto(this); @@ -53,7 +53,7 @@ public class TemplateCardQuestionInfo /// 事件KEY值 /// [XmlElement("SelectedItem")] - public List Items { get; set; } + public List? Items { get; set; } } public class TemplateCardQuestion @@ -62,12 +62,12 @@ public class TemplateCardQuestion /// 问题的key值 /// [XmlElement("QuestionKey")] - public string QuestionKey { get; set; } + public string QuestionKey { get; set; } = default!; /// /// 问题的key值 /// [XmlArray("OptionIds")] - public List OptionIds { get; set; } + public List? OptionIds { get; set; } } public class TemplateCardQuestionOption @@ -76,5 +76,5 @@ public class TemplateCardQuestionOption /// 问题的key值 /// [XmlElement("OpitonId")] - public List Items { get; set; } + public List? Items { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TextMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TextMessage.cs index ea1c3ac46..3ed6e07c3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TextMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/TextMessage.cs @@ -13,7 +13,7 @@ public class TextMessage : WeChatWorkGeneralMessage /// 文本消息内容 /// [XmlElement("Content")] - public string Content { get; set; } + public string Content { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatWorkGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/VideoMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/VideoMessage.cs index 729591b92..e1d81a8f2 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/VideoMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/VideoMessage.cs @@ -13,12 +13,12 @@ public class VideoMessage : WeChatWorkGeneralMessage /// 视频消息缩略图的媒体id,可以调用多媒体文件下载接口拉取数据。 /// [XmlElement("ThumbMediaId")] - public string ThumbMediaId { get; set; } + public string ThumbMediaId { get; set; } = default!; /// /// 视频消息媒体id,可以调用获取临时素材接口拉取数据。 /// [XmlElement("MediaId")] - public string MediaId { get; set; } + public string MediaId { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatWorkGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/VoiceMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/VoiceMessage.cs index ac4233ce3..db8f654f7 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/VoiceMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/VoiceMessage.cs @@ -13,12 +13,12 @@ public class VoiceMessage : WeChatWorkGeneralMessage /// 语音格式,如amr,speex等 /// [XmlElement("Format")] - public string Format { get; set; } + public string Format { get; set; } = default!; /// /// 语音消息媒体id,可以调用获取临时素材接口拉取该媒体 /// [XmlElement("MediaId")] - public string MediaId { get; set; } + public string MediaId { get; set; } = default!; public override WeChatMessageEto ToEto() { return new WeChatWorkGeneralMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkEventMessageEto.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkEventMessageEto.cs index 5a72bd16e..eddb795cb 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkEventMessageEto.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkEventMessageEto.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.WeChat.Work.Common.Messages; public class WeChatWorkEventMessageEto : WeChatMessageEto where TEvent : WeChatWorkEventMessage { - public TEvent Event { get; set; } + public TEvent Event { get; set; } = default!; public WeChatWorkEventMessageEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkGeneralMessageEto.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkGeneralMessageEto.cs index fb143b78c..f0f36985e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkGeneralMessageEto.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkGeneralMessageEto.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.WeChat.Work.Common.Messages; public class WeChatWorkGeneralMessageEto : WeChatMessageEto where TMessage : WeChatWorkGeneralMessage { - public TMessage Message { get; set; } + public TMessage Message { get; set; } = default!; public WeChatWorkGeneralMessageEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkMessageResolveContributor.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkMessageResolveContributor.cs index 0a5be5f72..35b630faf 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkMessageResolveContributor.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/WeChatWorkMessageResolveContributor.cs @@ -1,4 +1,5 @@ using LINGYUN.Abp.WeChat.Common.Messages; +using System; using System.Threading.Tasks; namespace LINGYUN.Abp.WeChat.Work.Common.Messages; @@ -12,7 +13,8 @@ public class WeChatWorkMessageResolveContributor : WeChatWorkMessageResolveContr protected override Task ResolveMessageAsync(IMessageResolveContext context, AbpWeChatWorkMessageResolveOptions options) { var messageType = context.GetMessageData("MsgType"); - if (options.MessageMaps.TryGetValue(messageType, out var messageFactory)) + if (!messageType.IsNullOrWhiteSpace() && + options.MessageMaps.TryGetValue(messageType, out var messageFactory)) { context.Message = messageFactory(context); context.Handled = true; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/EnumToNumberStringConverter.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/EnumToNumberStringConverter.cs index 316b4d887..a6de69af2 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/EnumToNumberStringConverter.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/EnumToNumberStringConverter.cs @@ -2,7 +2,6 @@ namespace Newtonsoft.Json; -#nullable enable public class EnumToNumberStringConverter : JsonConverter where T : struct, Enum { public override bool CanConvert(Type objectType) @@ -58,5 +57,4 @@ public class EnumToNumberStringConverter : JsonConverter where T : struct, En } } } -#nullable disable diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/ExternalProfileNewtonsoftJsonConverter.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/ExternalProfileNewtonsoftJsonConverter.cs index 5da19c778..7846e4e54 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/ExternalProfileNewtonsoftJsonConverter.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/ExternalProfileNewtonsoftJsonConverter.cs @@ -9,7 +9,7 @@ internal class ExternalProfileNewtonsoftJsonConverter : JsonConverter true; - public override void WriteJson(JsonWriter writer, ExternalProfile value, JsonSerializer serializer) + public override void WriteJson(JsonWriter writer, ExternalProfile? value, JsonSerializer serializer) { writer.WriteStartObject(); @@ -34,7 +34,7 @@ internal class ExternalProfileNewtonsoftJsonConverter : JsonConverter { - public override bool CanConvert(Type objectType) - { - return objectType == typeof(bool); - } - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + public override bool ReadJson(JsonReader reader, Type objectType, bool existingValue, bool hasExistingValue, JsonSerializer serializer) { switch (reader.TokenType) { case JsonToken.Integer: - var value = (long)reader.Value; - return value == 1; + return reader.ReadAsInt32() == 1; case JsonToken.Boolean: - return (bool)reader.Value; + return reader.ReadAsBoolean() == true; default: throw new JsonSerializationException($"Unexpected token {reader.TokenType} when parsing bool."); } } - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + public override void WriteJson(JsonWriter writer, bool value, JsonSerializer serializer) { - var boolValue = (bool)value; - writer.WriteValue(boolValue ? 1 : 0); + writer.WriteValue(value ? 1 : 0); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/System/Text/Json/Serialization/EnumToNumberStringConverter.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/System/Text/Json/Serialization/EnumToNumberStringConverter.cs index 1eaffeafc..5445a55fe 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/System/Text/Json/Serialization/EnumToNumberStringConverter.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/System/Text/Json/Serialization/EnumToNumberStringConverter.cs @@ -1,6 +1,5 @@ namespace System.Text.Json.Serialization; -#nullable enable public class EnumToNumberStringConverter : JsonConverter where T : struct, Enum { public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) @@ -42,4 +41,3 @@ public class EnumToNumberStringConverter : JsonConverter where T : struct } } } -#nullable disable diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/Department.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/Department.cs index fa099ff1a..f505f6a41 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/Department.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/Department.cs @@ -14,12 +14,12 @@ public class Department [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 部门id /// [NotNull] [JsonProperty("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/DepartmentInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/DepartmentInfo.cs index 75004d468..e9569b82c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/DepartmentInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/DepartmentInfo.cs @@ -21,7 +21,7 @@ public class DepartmentInfo : Department [NotNull] [JsonProperty("department_leader")] [JsonPropertyName("department_leader")] - public string[] DepartmentLeader { get; set; } + public string[] DepartmentLeader { get; set; } = default!; /// /// 父部门id。根部门为1 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/SubDepartment.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/SubDepartment.cs index ae9733f20..b58a87ed9 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/SubDepartment.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/SubDepartment.cs @@ -14,7 +14,7 @@ public class SubDepartment [NotNull] [JsonProperty("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; /// /// 父部门id。根部门为1。 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentListResponse.cs index 35f76c5ff..76a759f31 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentListResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetDepartmentListResponse : WeChatWorkResponse [NotNull] [JsonProperty("department")] [JsonPropertyName("department")] - public DepartmentInfo[] Department { get; set; } + public DepartmentInfo[] Department { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentResponse.cs index 536c91f78..74ce50ca3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetDepartmentResponse : WeChatWorkResponse [NotNull] [JsonProperty("department")] [JsonPropertyName("department")] - public DepartmentInfo Department { get; set; } + public DepartmentInfo Department { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetSubDepartmentListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetSubDepartmentListResponse.cs index 0335e87e9..077526920 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetSubDepartmentListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetSubDepartmentListResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetSubDepartmentListResponse : WeChatWorkResponse [NotNull] [JsonProperty("department_id")] [JsonPropertyName("department_id")] - public SubDepartment[] Department { get; set; } + public SubDepartment[] Department { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentMember.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentMember.cs index 2297ab335..1e4b1c4d6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentMember.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentMember.cs @@ -14,14 +14,14 @@ public class DepartmentMember [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 成员名称,代开发自建应用需要管理员授权才返回 /// [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 成员所属部门列表。列表项为部门ID,32位整型 /// @@ -35,5 +35,5 @@ public class DepartmentMember [NotNull] [JsonProperty("open_userid")] [JsonPropertyName("open_userid")] - public string OpenUserId { get; set; } + public string OpenUserId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentUser.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentUser.cs index 9b1116a08..cfb31b651 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentUser.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentUser.cs @@ -14,12 +14,12 @@ public class DepartmentUser [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 用户所属部门 /// [NotNull] [JsonProperty("department")] [JsonPropertyName("department")] - public int Department { get; set; } + public int Department { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberAttribute.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberAttribute.cs index ee687ba42..9e6fe38c8 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberAttribute.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberAttribute.cs @@ -14,7 +14,7 @@ public abstract class MemberAttribute [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 属性类型 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberExternalAttribute.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberExternalAttribute.cs index d3c0f103b..98ab4f941 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberExternalAttribute.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberExternalAttribute.cs @@ -14,5 +14,5 @@ public class MemberExternalAttribute [NotNull] [JsonProperty("attrs")] [JsonPropertyName("attrs")] - public MemberAttribute[] Attributes { get; set; } + public MemberAttribute[] Attributes { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberInfo.cs index 17ebe2f97..3c809fc8d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberInfo.cs @@ -15,21 +15,21 @@ public class MemberInfo [NotNull] [JsonProperty("open_userid")] [JsonPropertyName("open_userid")] - public string OpenUserId { get; set; } + public string OpenUserId { get; set; } = default!; /// /// 成员UserID /// [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 成员名称 /// [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 手机号码 /// @@ -43,7 +43,7 @@ public class MemberInfo [NotNull] [JsonProperty("department")] [JsonPropertyName("department")] - public int[] Department { get; set; } + public int[] Department { get; set; } = default!; /// /// 主部门 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberTextAttribute.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberTextAttribute.cs index a8c10b40b..5dfabf52a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberTextAttribute.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberTextAttribute.cs @@ -14,7 +14,7 @@ public class MemberTextAttribute : MemberAttribute [NotNull] [JsonProperty("text")] [JsonPropertyName("text")] - public MemberTextModel Text { get; set; } + public MemberTextModel Text { get; set; } = default!; } public class MemberTextModel @@ -25,5 +25,5 @@ public class MemberTextModel [NotNull] [JsonProperty("value")] [JsonPropertyName("value")] - public string Value { get; set; } + public string Value { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberWebAttribute.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberWebAttribute.cs index e1c0b0279..08bb85e9e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberWebAttribute.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberWebAttribute.cs @@ -14,7 +14,7 @@ public class MemberWebAttribute : MemberAttribute [NotNull] [JsonProperty("web")] [JsonPropertyName("web")] - public MemberWebModel Web { get; set; } + public MemberWebModel Web { get; set; } = default!; } public class MemberWebModel @@ -25,12 +25,12 @@ public class MemberWebModel [NotNull] [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string Url { get; set; } = default!; /// /// 网页的展示标题,长度限制12个UTF8字符 /// [NotNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string Title { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkCreateMemberRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkCreateMemberRequest.cs index c81e848a9..3b68b5cf6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkCreateMemberRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkCreateMemberRequest.cs @@ -181,6 +181,15 @@ public class WeChatWorkCreateMemberRequest : WeChatWorkRequest [JsonProperty("main_department")] [JsonPropertyName("main_department")] public int? MainDepartment { get; set; } + + public WeChatWorkCreateMemberRequest( + string userId, + string name) + { + UserId = userId; + Name = name; + } + protected override void Validate() { Check.NotNullOrWhiteSpace(UserId, nameof(UserId), 64, 1); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkUpdateMemberRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkUpdateMemberRequest.cs index 38fee98a4..918392e54 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkUpdateMemberRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkUpdateMemberRequest.cs @@ -191,6 +191,14 @@ public class WeChatWorkUpdateMemberRequest : WeChatWorkRequest [JsonPropertyName("main_department")] public int? MainDepartment { get; set; } + public WeChatWorkUpdateMemberRequest( + string userId, + string name) + { + UserId = userId; + Name = name; + } + protected override void Validate() { Check.NotNullOrWhiteSpace(UserId, nameof(UserId), 64, 1); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkBulkInviteMemberResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkBulkInviteMemberResponse.cs index f0fe6c77a..2b21f23f9 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkBulkInviteMemberResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkBulkInviteMemberResponse.cs @@ -17,19 +17,19 @@ public class WeChatWorkBulkInviteMemberResponse : WeChatWorkResponse [NotNull] [JsonProperty("invaliduser")] [JsonPropertyName("invaliduser")] - public string[] InvalidUser { get; set; } + public string[] InvalidUser { get; set; } = default!; /// /// 非法部门列表 /// [NotNull] [JsonProperty("invalidparty")] [JsonPropertyName("invalidparty")] - public int[] InvalidParty { get; set; } + public int[] InvalidParty { get; set; } = default!; /// /// 非法标签列表 /// [NotNull] [JsonProperty("invalidtag")] [JsonPropertyName("invalidtag")] - public int[] InvalidTag { get; set; } + public int[] InvalidTag { get; set; } = default!; } \ No newline at end of file diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToOpenIdResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToOpenIdResponse.cs index a1b9050bf..e3d0c49a4 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToOpenIdResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToOpenIdResponse.cs @@ -17,5 +17,5 @@ public class WeChatWorkConvertToOpenIdResponse : WeChatWorkResponse [NotNull] [JsonProperty("openid")] [JsonPropertyName("openid")] - public string OpenId { get; set; } + public string OpenId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToUserIdResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToUserIdResponse.cs index efb7d2f47..9f1ec7822 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToUserIdResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToUserIdResponse.cs @@ -17,5 +17,5 @@ public class WeChatWorkConvertToUserIdResponse : WeChatWorkResponse [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetJoinQrCodeResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetJoinQrCodeResponse.cs index bf75a1766..06e70bc5a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetJoinQrCodeResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetJoinQrCodeResponse.cs @@ -17,5 +17,5 @@ public class WeChatWorkGetJoinQrCodeResponse : WeChatWorkResponse [NotNull] [JsonProperty("join_qrcode")] [JsonPropertyName("join_qrcode")] - public string JoinQrcCode { get; set; } + public string JoinQrcCode { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberListResponse.cs index cededeed8..9bbeb0158 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberListResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetMemberListResponse : WeChatWorkResponse [NotNull] [JsonProperty("userlist")] [JsonPropertyName("userlist")] - public MemberInfo[] UserList { get; set; } + public MemberInfo[] UserList { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberResponse.cs index e7edf1ac0..054a1b962 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberResponse.cs @@ -19,21 +19,21 @@ public class WeChatWorkGetMemberResponse : WeChatWorkResponse [NotNull] [JsonProperty("open_userid")] [JsonPropertyName("open_userid")] - public string OpenUserId { get; set; } + public string OpenUserId { get; set; } = default!; /// /// 成员UserID /// [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 成员名称 /// [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 手机号码 /// @@ -47,7 +47,7 @@ public class WeChatWorkGetMemberResponse : WeChatWorkResponse [NotNull] [JsonProperty("department")] [JsonPropertyName("department")] - public int[] Department { get; set; } + public int[] Department { get; set; } = default!; /// /// 主部门 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetSimpleMemberListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetSimpleMemberListResponse.cs index 9a1c4c6b5..ba86934e6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetSimpleMemberListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetSimpleMemberListResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetSimpleMemberListResponse : WeChatWorkResponse [NotNull] [JsonProperty("userlist")] [JsonPropertyName("userlist")] - public DepartmentMember[] UserList { get; set; } + public DepartmentMember[] UserList { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdListResponse.cs index f768f101d..8b8dfb000 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdListResponse.cs @@ -25,5 +25,5 @@ public class WeChatWorkGetUserIdListResponse : WeChatWorkResponse [NotNull] [JsonProperty("dept_user")] [JsonPropertyName("dept_user")] - public DepartmentUser[] DepartmentUser { get; set; } + public DepartmentUser[] DepartmentUser { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdResponse.cs index 23dec2bf1..634ca0a69 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdResponse.cs @@ -14,5 +14,5 @@ public class WeChatWorkGetUserIdResponse : WeChatWorkResponse [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/BatchJobResultEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/BatchJobResultEvent.cs index 03edca67d..0c2d360c4 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/BatchJobResultEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/BatchJobResultEvent.cs @@ -17,7 +17,7 @@ public class BatchJobResultEvent : WeChatWorkEventMessage /// 异步任务信息 /// [XmlElement("BatchJob")] - public BatchJob BatchJob { get; set; } + public BatchJob BatchJob { get; set; } = default!; public override WeChatMessageEto ToEto() { @@ -31,12 +31,12 @@ public class BatchJob /// 异步任务id,最大长度为64字符 /// [XmlElement("JobId")] - public string JobId { get; set; } + public string JobId { get; set; } = default!; /// /// 操作类型,字符串,目前分别有:sync_user(增量更新成员)、 replace_user(全量覆盖成员)、invite_user(邀请成员关注)、replace_party(全量覆盖部门) /// [XmlElement("JobType")] - public string JobType { get; set; } + public string JobType { get; set; } = default!; /// /// 返回码 /// @@ -46,5 +46,5 @@ public class BatchJob /// 对返回码的文本描述内容 /// [XmlElement("ErrMsg")] - public string ErrMsg { get; set; } + public string? ErrMsg { get; set; } } \ No newline at end of file diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteDepartmentEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteDepartmentEvent.cs index 217a2fd1c..c2ac00d12 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteDepartmentEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteDepartmentEvent.cs @@ -14,7 +14,7 @@ public class DeleteDepartmentEvent : WeChatWorkEventMessage /// 部门Id /// [XmlElement("Id")] - public string Id { get; set; } + public string Id { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteUserEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteUserEvent.cs index d3acb35d6..9bfc3b786 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteUserEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteUserEvent.cs @@ -14,7 +14,7 @@ public class DeleteUserEvent : WeChatWorkEventMessage /// 变更信息的成员UserID /// [XmlElement("UserID")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DepartmentUpdateEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DepartmentUpdateEvent.cs index efaa71948..c54fd9c21 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DepartmentUpdateEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DepartmentUpdateEvent.cs @@ -16,7 +16,7 @@ public abstract class DepartmentUpdateEvent : WeChatWorkEventMessage /// 部门名称 /// [XmlElement("Name")] - public int Name { get; set; } + public string Name { get; set; } = default!; /// /// 父部门id /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UpdateUserEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UpdateUserEvent.cs index 8daffa018..d3470530d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UpdateUserEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UpdateUserEvent.cs @@ -14,7 +14,7 @@ public class UpdateUserEvent : UserChangeEvent /// 新的UserID,变更时推送(userid由系统生成时可更改一次) /// [XmlElement("NewUserID")] - public string NewUserId { get; set; } + public string NewUserId { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserChangeEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserChangeEvent.cs index e2a8dcda7..0dab46942 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserChangeEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserChangeEvent.cs @@ -12,27 +12,27 @@ public abstract class UserChangeEvent : WeChatWorkEventMessage /// 改变类型 /// [XmlElement("ChangeType")] - public string ChangeType { get; set; } + public string ChangeType { get; set; } = default!; /// /// 成员UserID /// [XmlElement("UserID")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 成员名称;代开发自建应用需要管理员授权才返回 /// [XmlElement("Name")] - public string Name { get; set; } + public string? Name { get; set; } /// /// 成员部门列表,仅返回该应用有查看权限的部门id /// [XmlElement("Department")] - public string Department { get; set; } + public string? Department { get; set; } /// /// 主部门 /// [XmlElement("MainDepartment")] - public string MainDepartment { get; set; } + public string MainDepartment { get; set; } = default!; /// /// 表示所在部门是否为部门负责人, /// 0-否, @@ -43,7 +43,7 @@ public abstract class UserChangeEvent : WeChatWorkEventMessage /// 上游企业不可获取下游企业成员该字段 /// [XmlElement("IsLeaderInDept")] - public string IsLeaderInDept { get; set; } + public string IsLeaderInDept { get; set; } = default!; /// /// 直属上级UserID,最多1个。 /// 第三方通讯录应用或者授权了“组织架构信息-应用可获取可见范围内成员组织架构信息-直属上级”权限的第三方应用和代开发应用可获取; @@ -51,14 +51,14 @@ public abstract class UserChangeEvent : WeChatWorkEventMessage /// 上游企业不可获取下游企业成员该字段 /// [XmlElement("DirectLeader")] - public string DirectLeader { get; set; } + public string DirectLeader { get; set; } = default!; /// /// 职位信息。 /// 长度为0~64个字节;代开发自建应用需要管理员授权才返回。 /// 上游共享的应用不返回该字段 /// [XmlElement("Position")] - public string Position { get; set; } + public string? Position { get; set; } /// /// 手机号码,代开发自建应用需要管理员授权且成员oauth2授权获取; /// 第三方仅通讯录应用可获取; @@ -66,7 +66,7 @@ public abstract class UserChangeEvent : WeChatWorkEventMessage /// 上游企业不可获取下游企业成员该字段 /// [XmlElement("Mobile")] - public string Mobile { get; set; } + public string? Mobile { get; set; } /// /// 性别。 /// 0表示未定义, @@ -88,7 +88,7 @@ public abstract class UserChangeEvent : WeChatWorkEventMessage /// 上游企业不可获取下游企业成员该字段 /// [XmlElement("Email")] - public string Email { get; set; } + public string? Email { get; set; } /// /// 企业邮箱, /// 代开发自建应用需要管理员授权且成员oauth2授权获取; @@ -97,7 +97,7 @@ public abstract class UserChangeEvent : WeChatWorkEventMessage /// 上游企业不可获取下游企业成员该字段 /// [XmlElement("BizMail")] - public string BizMail { get; set; } + public string? BizMail { get; set; } /// /// 激活状态: /// 1=已激活 @@ -116,20 +116,20 @@ public abstract class UserChangeEvent : WeChatWorkEventMessage /// 上游企业不可获取下游企业成员该字段 /// [XmlElement("Avatar")] - public string Avatar { get; set; } + public string? Avatar { get; set; } /// /// 成员别名。 /// 上游共享的应用不返回该字段 /// [XmlElement("Alias")] - public string Alias { get; set; } + public string? Alias { get; set; } /// /// 座机; /// 代开发自建应用需要管理员授权才返回。 /// 上游共享的应用不返回该字段 /// [XmlElement("Telephone")] - public string Telephone { get; set; } + public string? Telephone { get; set; } /// /// 地址。 /// 代开发自建应用需要管理员授权且成员oauth2授权获取; @@ -138,12 +138,12 @@ public abstract class UserChangeEvent : WeChatWorkEventMessage /// 上游企业不可获取下游企业成员该字段 /// [XmlElement("Address")] - public string Address { get; set; } + public string? Address { get; set; } /// /// 扩展属性; /// 代开发自建应用需要管理员授权才返回。 /// 上游共享的应用不返回该字段 /// [XmlArray("ExtAttr")] - public MemberExtendAttribute ExtendAttribute { get; set; } + public MemberExtendAttribute? ExtendAttribute { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserTagChangeEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserTagChangeEvent.cs index b3c0d4db6..7e6c005c3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserTagChangeEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserTagChangeEvent.cs @@ -14,27 +14,27 @@ public class UserTagChangeEvent : WeChatWorkEventMessage /// 标签Id /// [XmlElement("TagId")] - public string TagId { get; set; } + public string TagId { get; set; } = default!; /// /// 标签中新增的成员userid列表,用逗号分隔 /// [XmlElement("AddUserItems", IsNullable = true)] - public string AddUserItems { get; set; } + public string? AddUserItems { get; set; } /// /// 标签中删除的成员userid列表,用逗号分隔 /// [XmlElement("DelUserItems", IsNullable = true)] - public string DelUserItems { get; set; } + public string? DelUserItems { get; set; } /// /// 标签中新增的部门id列表,用逗号分隔 /// [XmlElement("AddPartyItems", IsNullable = true)] - public string AddPartyItems { get; set; } + public string? AddPartyItems { get; set; } /// /// 标签中删除的部门id列表,用逗号分隔 /// [XmlElement("DelPartyItems", IsNullable = true)] - public string DelPartyItems { get; set; } + public string? DelPartyItems { get; set; } public override WeChatMessageEto ToEto() { return new WeChatWorkEventMessageEto(this); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagInfo.cs index 743f4e76c..ad90ed8f0 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagInfo.cs @@ -21,5 +21,5 @@ public class TagInfo [NotNull] [JsonProperty("tagname")] [JsonPropertyName("tagname")] - public string TagName { get; set; } + public string TagName { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagUserInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagUserInfo.cs index 21c11ada2..ba6877b9e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagUserInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagUserInfo.cs @@ -14,12 +14,12 @@ public class TagUserInfo [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 成员名称 /// [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagChangeMemberResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagChangeMemberResponse.cs index 50623e229..765deab3c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagChangeMemberResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagChangeMemberResponse.cs @@ -14,7 +14,7 @@ public class WeChatWorkTagChangeMemberResponse : WeChatWorkResponse [CanBeNull] [JsonProperty("invalidlist")] [JsonPropertyName("invalidlist")] - public string InvalidList { get; set; } + public string? InvalidList { get; set; } /// /// 若部分partylist非法,则返回 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagListResponse.cs index 40a3753aa..4e53f736f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagListResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkTagListResponse : WeChatWorkResponse [NotNull] [JsonProperty("taglist")] [JsonPropertyName("taglist")] - public TagInfo[] Tags { get; set; } + public TagInfo[] Tags { get; set; } = default!; } \ No newline at end of file diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagMemberInfoResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagMemberInfoResponse.cs index 349c0b592..bb2f631eb 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagMemberInfoResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagMemberInfoResponse.cs @@ -18,19 +18,19 @@ public class WeChatWorkTagMemberInfoResponse : WeChatWorkResponse [NotNull] [JsonProperty("tagname")] [JsonPropertyName("tagname")] - public string TagName { get; set; } + public string TagName { get; set; } = default!; /// /// 标签中包含的成员列表 /// [NotNull] [JsonProperty("userlist")] [JsonPropertyName("userlist")] - public TagUserInfo[] Users { get; set; } + public TagUserInfo[] Users { get; set; } = default!; /// /// 标签中包含的部门id列表 /// [NotNull] [JsonProperty("partylist")] [JsonPropertyName("partylist")] - public int[] Parts { get; set; } + public int[] Parts { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Attachments/Response/WeChatWorkUploadAttachmentResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Attachments/Response/WeChatWorkUploadAttachmentResponse.cs index 46f1045f7..ec5984051 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Attachments/Response/WeChatWorkUploadAttachmentResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Attachments/Response/WeChatWorkUploadAttachmentResponse.cs @@ -17,14 +17,14 @@ public class WeChatWorkUploadAttachmentResponse : WeChatWorkResponse [NotNull] [JsonProperty("type")] [JsonPropertyName("type")] - public string MediaType { get; set; } + public string MediaType { get; set; } = default!; /// /// 媒体文件上传后获取的唯一标识,三天有效,可使用获取临时素材接口获取 /// [NotNull] [JsonProperty("media_id")] [JsonPropertyName("media_id")] - public string MediaId { get; set; } + public string MediaId { get; set; } = default!; /// /// 媒体文件上传时间戳 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Contacts/Models/ExternalContactInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Contacts/Models/ExternalContactInfo.cs index 2e53003fc..04b2ecc74 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Contacts/Models/ExternalContactInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Contacts/Models/ExternalContactInfo.cs @@ -27,7 +27,7 @@ public class ExternalContactInfo [NotNull] [JsonProperty("tmp_openid")] [JsonPropertyName("tmp_openid")] - public string TmpOpenId { get; set; } + public string TmpOpenId { get; set; } = default!; /// /// 外部联系人的externaluserid(如果是客户才返回) /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Contacts/Response/WeChatWorkGetExternalContactListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Contacts/Response/WeChatWorkGetExternalContactListResponse.cs index 4492b93ca..a6d35b51f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Contacts/Response/WeChatWorkGetExternalContactListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Contacts/Response/WeChatWorkGetExternalContactListResponse.cs @@ -18,7 +18,7 @@ public class WeChatWorkGetExternalContactListResponse : WeChatWorkResponse [NotNull] [JsonProperty("info_list")] [JsonPropertyName("info_list")] - public ExternalContactInfo[] InfoList { get; set; } + public ExternalContactInfo[] InfoList { get; set; } = default!; /// /// 分页游标,再下次请求时填写以获取之后分页的记录,如果已经没有更多的数据则返回空,有效期为4小时 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/CustomerStrategyInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/CustomerStrategyInfo.cs index dec0bdb1f..467888269 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/CustomerStrategyInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/CustomerStrategyInfo.cs @@ -21,7 +21,7 @@ public class CustomerStrategyInfo : CustomerStrategy [NotNull] [JsonProperty("strategy_name")] [JsonPropertyName("strategy_name")] - public string StrategyName { get; set; } + public string StrategyName { get; set; } = default!; /// /// 规则组创建时间戳 /// @@ -35,12 +35,12 @@ public class CustomerStrategyInfo : CustomerStrategy [NotNull] [JsonProperty("admin_list")] [JsonPropertyName("admin_list")] - public string[] AdminList { get; set; } + public string[] AdminList { get; set; } = default!; /// /// 规则组权限 /// [NotNull] [JsonProperty("privilege")] [JsonPropertyName("privilege")] - public CustomerStrategyPrivilege Privilege { get; set; } + public CustomerStrategyPrivilege Privilege { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/ExternalContactInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/ExternalContactInfo.cs index 0829e15f5..eedfccaaa 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/ExternalContactInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/ExternalContactInfo.cs @@ -15,7 +15,7 @@ public class ExternalContactInfo [NotNull] [JsonProperty("external_userid")] [JsonPropertyName("external_userid")] - public string ExternalUserId { get; set; } + public string ExternalUserId { get; set; } = default!; /// /// 外部联系人的名称 /// @@ -26,7 +26,7 @@ public class ExternalContactInfo [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 外部联系人头像 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/ExternalContactList.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/ExternalContactList.cs index 7ace31afb..07729ee71 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/ExternalContactList.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/ExternalContactList.cs @@ -14,12 +14,12 @@ public class ExternalContactList [NotNull] [JsonProperty("external_contact")] [JsonPropertyName("external_contact")] - public ExternalContactInfo ExternalContact { get; set; } + public ExternalContactInfo ExternalContact { get; set; } = default!; /// /// 企业成员客户跟进信息 /// [NotNull] [JsonProperty("follow_info")] [JsonPropertyName("follow_info")] - public FollowUser FollowUser { get; set; } + public FollowUser FollowUser { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUser.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUser.cs index 6225a3b76..2b1560ac0 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUser.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUser.cs @@ -15,7 +15,7 @@ public class FollowUser [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 发起添加的userid
/// 如果成员主动添加,为成员的userid;
@@ -25,7 +25,7 @@ public class FollowUser [NotNull] [JsonProperty("oper_userid")] [JsonPropertyName("oper_userid")] - public string OperUserId { get; set; } + public string OperUserId { get; set; } = default!; /// /// 企业自定义的state参数,用于区分客户具体是通过哪个「联系我」或获客链接添加 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUserTag.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUserTag.cs index d11bfbd9c..693a1967e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUserTag.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUserTag.cs @@ -21,7 +21,7 @@ public class FollowUserTag [NotNull] [JsonProperty("tag_name")] [JsonPropertyName("tag_name")] - public string TagName { get; set; } + public string TagName { get; set; } = default!; /// /// 该成员添加此外部联系人所打标签类型 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUserWechatChannel.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUserWechatChannel.cs index b1a1b6b26..95b564f98 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUserWechatChannel.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Models/FollowUserWechatChannel.cs @@ -14,7 +14,7 @@ public class FollowUserWechatChannel [NotNull] [JsonProperty("nickname")] [JsonPropertyName("nickname")] - public string NickName { get; set; } + public string NickName { get; set; } = default!; /// /// 视频号添加场景 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Request/WeChatWorkCreateCustomerStrategyRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Request/WeChatWorkCreateCustomerStrategyRequest.cs index 1fa6506cb..667112471 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Request/WeChatWorkCreateCustomerStrategyRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Request/WeChatWorkCreateCustomerStrategyRequest.cs @@ -70,5 +70,6 @@ public class WeChatWorkCreateCustomerStrategyRequest : WeChatWorkRequest StrategyName = strategyName; AdminList = adminList; Privilege = privilege ?? CustomerStrategyPrivilege.Default(); + Range = range ?? []; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerResponse.cs index d465abe38..7730b194d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerResponse.cs @@ -19,14 +19,14 @@ public class WeChatWorkGetCustomerResponse : WeChatWorkResponse [NotNull] [JsonProperty("external_contact")] [JsonPropertyName("external_contact")] - public ExternalContactInfo ExternalContact { get; set; } + public ExternalContactInfo ExternalContact { get; set; } = default!; /// /// 添加了此外部联系人的企业成员 /// [NotNull] [JsonProperty("follow_user")] [JsonPropertyName("follow_user")] - public List FollowUser { get; set; } + public List FollowUser { get; set; } = default!; /// /// 分页的cursor,当跟进人多于500人时返回 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyListResponse.cs index b386da41c..9452bcce7 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyListResponse.cs @@ -18,7 +18,7 @@ public class WeChatWorkGetCustomerStrategyListResponse : WeChatWorkResponse [NotNull] [JsonProperty("strategy")] [JsonPropertyName("strategy")] - public CustomerStrategy[] Strategy { get; set; } + public CustomerStrategy[] Strategy { get; set; } = default!; /// /// 分页游标,用于查询下一个分页的数据,无更多数据时不返回 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyRangeResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyRangeResponse.cs index 39ee4de11..4959a6acd 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyRangeResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyRangeResponse.cs @@ -18,7 +18,7 @@ public class WeChatWorkGetCustomerStrategyRangeResponse : WeChatWorkResponse [NotNull] [JsonProperty("range")] [JsonPropertyName("range")] - public CustomerStrategyRange[] Range { get; set; } + public CustomerStrategyRange[] Range { get; set; } = default!; /// /// 分页游标,用于查询下一个分页的数据,无更多数据时不返回 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyResponse.cs index 0b3eba400..bc629878f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Customers/Response/WeChatWorkGetCustomerStrategyResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetCustomerStrategyResponse : WeChatWorkResponse [NotNull] [JsonProperty("strategy")] [JsonPropertyName("strategy")] - public CustomerStrategyInfo Strategy { get; set; } + public CustomerStrategyInfo Strategy { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChat.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChat.cs index e9d6f34bb..f081ac4eb 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChat.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChat.cs @@ -14,7 +14,7 @@ public class GroupChat [NotNull] [JsonProperty("chat_id")] [JsonPropertyName("chat_id")] - public string ChatId { get; set; } + public string ChatId { get; set; } = default!; /// /// 客户群跟进状态 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatInfo.cs index 84c173240..2dac9c351 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatInfo.cs @@ -14,21 +14,21 @@ public class GroupChatInfo [NotNull] [JsonProperty("chat_id")] [JsonPropertyName("chat_id")] - public string ChatId { get; set; } + public string ChatId { get; set; } = default!; /// /// 群名 /// [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 群主ID /// [NotNull] [JsonProperty("owner")] [JsonPropertyName("owner")] - public string Owner { get; set; } + public string Owner { get; set; } = default!; /// /// 群的创建时间 /// @@ -42,26 +42,26 @@ public class GroupChatInfo [CanBeNull] [JsonProperty("notice")] [JsonPropertyName("notice")] - public string Notice { get; set; } + public string? Notice { get; set; } /// /// 群成员列表 /// [NotNull] [JsonProperty("member_list")] [JsonPropertyName("member_list")] - public GroupChatMember[] MemberList { get; set; } + public GroupChatMember[] MemberList { get; set; } = default!; /// /// 群管理员列表 /// [NotNull] [JsonProperty("admin_list")] [JsonPropertyName("admin_list")] - public GroupChatManager[] AdminList { get; set; } + public GroupChatManager[] AdminList { get; set; } = default!; /// /// 当前群成员版本号。可以配合客户群变更事件减少主动调用本接口的次数 /// [NotNull] [JsonProperty("member_version")] [JsonPropertyName("member_version")] - public string MemberVersion { get; set; } + public string MemberVersion { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatInvitor.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatInvitor.cs index 201decd88..b4e655401 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatInvitor.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatInvitor.cs @@ -14,5 +14,5 @@ public class GroupChatInvitor [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatManager.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatManager.cs index 1a53a0781..015b83e6b 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatManager.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatManager.cs @@ -14,5 +14,5 @@ public class GroupChatManager [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatMember.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatMember.cs index 937f07841..6ce197f19 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatMember.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Models/GroupChatMember.cs @@ -14,7 +14,7 @@ public class GroupChatMember [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 成员类型 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkGetGroupChatListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkGetGroupChatListResponse.cs index 1a0d2b81e..0a28eaabe 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkGetGroupChatListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkGetGroupChatListResponse.cs @@ -18,7 +18,7 @@ public class WeChatWorkGetGroupChatListResponse : WeChatWorkResponse [NotNull] [JsonProperty("group_chat_list")] [JsonPropertyName("group_chat_list")] - public GroupChat[] GroupChatList { get; set; } + public GroupChat[] GroupChatList { get; set; } = default!; /// /// 分页游标,下次请求时填写以获取之后分页的记录。如果该字段返回空则表示已没有更多数据 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkGetGroupChatResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkGetGroupChatResponse.cs index 8f58bbfb3..d7f92df2e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkGetGroupChatResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkGetGroupChatResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetGroupChatResponse : WeChatWorkResponse [NotNull] [JsonProperty("group_chat")] [JsonPropertyName("group_chat")] - public GroupChatInfo GroupChat { get; set; } + public GroupChatInfo GroupChat { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkOpengIdToChatIdResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkOpengIdToChatIdResponse.cs index ab1b981d5..a1bc067df 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkOpengIdToChatIdResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/GroupChats/Response/WeChatWorkOpengIdToChatIdResponse.cs @@ -17,5 +17,5 @@ public class WeChatWorkOpengIdToChatIdResponse : WeChatWorkResponse [NotNull] [JsonProperty("chat_id")] [JsonPropertyName("chat_id")] - public string ChatId { get; set; } + public string ChatId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatChangeEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatChangeEvent.cs index 9e7ab1eb6..e76bc45ce 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatChangeEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatChangeEvent.cs @@ -11,11 +11,11 @@ public abstract class ExternalChatChangeEvent : WeChatWorkEventMessage /// 变更类型 ///
[XmlElement("ChangeType")] - public string ChangeType { get; set; } + public string ChangeType { get; set; } = default!; /// /// 群ID /// [XmlElement("ChatId")] - public string ChatId { get; set; } + public string ChatId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatChangeMemberEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatChangeMemberEvent.cs index b64e10b84..09ad8d1f9 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatChangeMemberEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatChangeMemberEvent.cs @@ -21,12 +21,12 @@ public abstract class ExternalChatChangeMemberEvent : ExternalChatUpdateEvent /// 变更前的群成员版本号 /// [XmlElement("LastMemVer")] - public string LastMemVer { get; set; } + public string LastMemVer { get; set; } = default!; /// /// 变更后的群成员版本号 /// [XmlElement("CurMemVer")] - public string CurMemVer { get; set; } + public string CurMemVer { get; set; } = default!; } public class ExternalChatChangeMember @@ -35,5 +35,5 @@ public class ExternalChatChangeMember /// 成员Id /// [XmlElement("Item")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatUpdateEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatUpdateEvent.cs index 7b981dcdf..8b8725889 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatUpdateEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalChatUpdateEvent.cs @@ -15,5 +15,5 @@ public abstract class ExternalChatUpdateEvent : ExternalChatChangeEvent /// change_notice : 群公告变更 /// [XmlElement("UpdateDetail")] - public string UpdateDetail { get; set; } + public string UpdateDetail { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactChangeEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactChangeEvent.cs index 9d6fe930c..10dba14fa 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactChangeEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactChangeEvent.cs @@ -11,15 +11,15 @@ public abstract class ExternalContactChangeEvent : WeChatWorkEventMessage /// 变更类型 /// [XmlElement("ChangeType")] - public string ChangeType { get; set; } + public string ChangeType { get; set; } = default!; /// /// 企业服务人员的UserID /// [XmlElement("UserID")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 外部联系人的userid,注意不是企业成员的账号 /// [XmlElement("ExternalUserID")] - public string ExternalUserId { get; set; } + public string ExternalUserId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactCreateEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactCreateEvent.cs index 03ddacffb..9803b7868 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactCreateEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactCreateEvent.cs @@ -14,12 +14,12 @@ public class ExternalContactCreateEvent : ExternalContactChangeEvent /// 添加此用户的「联系我」方式配置的state参数,或在获客链接中指定的customer_channel参数,可用于识别添加此用户的渠道 /// [XmlElement("State")] - public string State { get; set; } + public string State { get; set; } = default!; /// /// 欢迎语code,可用于发送欢迎语 /// [XmlElement("WelcomeCode")] - public string WelcomeCode { get; set; } + public string WelcomeCode { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactCreateHalfEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactCreateHalfEvent.cs index 943b84f86..f393c7a3d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactCreateHalfEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactCreateHalfEvent.cs @@ -14,12 +14,12 @@ public class ExternalContactCreateHalfEvent : ExternalContactChangeEvent /// 添加此用户的「联系我」方式配置的state参数,或在获客链接中指定的customer_channel参数,可用于识别添加此用户的渠道 /// [XmlElement("State")] - public string State { get; set; } + public string State { get; set; } = default!; /// /// 欢迎语code,可用于发送欢迎语 /// [XmlElement("WelcomeCode")] - public string WelcomeCode { get; set; } + public string WelcomeCode { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactDeleteEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactDeleteEvent.cs index c67b70d30..be295dcef 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactDeleteEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactDeleteEvent.cs @@ -14,7 +14,7 @@ public class ExternalContactDeleteEvent : ExternalContactChangeEvent /// 删除客户的操作来源,DELETE_BY_TRANSFER表示此客户是因在职继承自动被转接成员删除 /// [XmlElement("Source")] - public string Source { get; set; } + public string Source { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactMsgAuditApprovedEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactMsgAuditApprovedEvent.cs index 8bc1e052c..f65ab0c9b 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactMsgAuditApprovedEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactMsgAuditApprovedEvent.cs @@ -14,7 +14,7 @@ public class ExternalContactMsgAuditApprovedEvent : ExternalContactChangeEvent /// 欢迎语code,可用于发送欢迎语 /// [XmlElement("WelcomeCode")] - public string WelcomeCode { get; set; } + public string WelcomeCode { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactTransferFailEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactTransferFailEvent.cs index dd60b40a4..a0a9378a6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactTransferFailEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalContactTransferFailEvent.cs @@ -14,7 +14,7 @@ public class ExternalContactTransferFailEvent : ExternalContactChangeEvent /// 接替失败的原因, customer_refused-客户拒绝, customer_limit_exceed-接替成员的客户数达到上限 /// [XmlElement("FailReason")] - public string FailReason { get; set; } + public string FailReason { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalTagChangeEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalTagChangeEvent.cs index e6bc43cb7..c433ac93c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalTagChangeEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Messages/Models/ExternalTagChangeEvent.cs @@ -11,10 +11,10 @@ public abstract class ExternalTagChangeEvent : WeChatWorkEventMessage /// 变更类型 /// [XmlElement("ChangeType")] - public string ChangeType { get; set; } + public string ChangeType { get; set; } = default!; /// /// 标签或标签组所属的规则组id,只回调给“客户联系”应用 /// [XmlElement("StrategyId")] - public string StrategyId { get; set; } + public string StrategyId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/RoomAgreeInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/RoomAgreeInfo.cs index 01722c9d0..521973dd0 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/RoomAgreeInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/RoomAgreeInfo.cs @@ -17,14 +17,14 @@ public class RoomAgreeInfo [NotNull] [JsonProperty("exteranalopenid")] [JsonPropertyName("exteranalopenid")] - public string ExteranalOpenId { get; set; } + public string ExteranalOpenId { get; set; } = default!; /// /// 同意:"Agree",不同意:"Disagree" /// [NotNull] [JsonProperty("agree_status")] [JsonPropertyName("agree_status")] - public string AgreeStatus { get; set; } + public string AgreeStatus { get; set; } = default!; /// /// 同意状态改变的具体时间,utc时间 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/RoomMember.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/RoomMember.cs index 762f05ba8..ea626a695 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/RoomMember.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/RoomMember.cs @@ -14,7 +14,7 @@ public class RoomMember [NotNull] [JsonProperty("memberid")] [JsonPropertyName("memberid")] - public string MemberId { get; set; } + public string MemberId { get; set; } = default!; /// /// roomid群成员的入群时间 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/UserAgreeInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/UserAgreeInfo.cs index a823f4e95..2efc0fa21 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/UserAgreeInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Models/UserAgreeInfo.cs @@ -14,21 +14,21 @@ public class UserAgreeInfo [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 外部成员的exteranalopenid /// [NotNull] [JsonProperty("exteranalopenid")] [JsonPropertyName("exteranalopenid")] - public string ExteranalOpenId { get; set; } + public string ExteranalOpenId { get; set; } = default!; /// /// 同意:"Agree",不同意:"Disagree" /// [NotNull] [JsonProperty("agree_status")] [JsonPropertyName("agree_status")] - public string AgreeStatus { get; set; } + public string AgreeStatus { get; set; } = default!; /// /// 同意状态改变的具体时间,utc时间 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkCheckRoomAgreeResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkCheckRoomAgreeResponse.cs index 06057c85a..3d35f19dc 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkCheckRoomAgreeResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkCheckRoomAgreeResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkCheckRoomAgreeResponse : WeChatWorkResponse [NotNull] [JsonProperty("agreeinfo")] [JsonPropertyName("agreeinfo")] - public RoomAgreeInfo[] AgreeInfo { get; set; } + public RoomAgreeInfo[] AgreeInfo { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkCheckSingleAgreeResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkCheckSingleAgreeResponse.cs index 99a3689b5..58fe7b09f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkCheckSingleAgreeResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkCheckSingleAgreeResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkCheckSingleAgreeResponse : WeChatWorkResponse [NotNull] [JsonProperty("agreeinfo")] [JsonPropertyName("agreeinfo")] - public UserAgreeInfo[] AgreeInfo { get; set; } + public UserAgreeInfo[] AgreeInfo { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkGetGroupChatResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkGetGroupChatResponse.cs index f6096b29a..a54d57189 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkGetGroupChatResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkGetGroupChatResponse.cs @@ -18,14 +18,14 @@ public class WeChatWorkGetGroupChatResponse : WeChatWorkResponse [NotNull] [JsonProperty("roomname")] [JsonPropertyName("roomname")] - public string RoomName { get; set; } + public string RoomName { get; set; } = default!; /// /// roomid对应的群创建者,userid /// [NotNull] [JsonProperty("creator")] [JsonPropertyName("creator")] - public string Creator { get; set; } + public string Creator { get; set; } = default!; /// /// roomid对应的群创建时间 /// @@ -46,5 +46,5 @@ public class WeChatWorkGetGroupChatResponse : WeChatWorkResponse [NotNull] [JsonProperty("members")] [JsonPropertyName("members")] - public RoomMember[] Members { get; set; } + public RoomMember[] Members { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkGetPermitUserListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkGetPermitUserListResponse.cs index a76a1587e..e833269c3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkGetPermitUserListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/MsgAudits/Response/WeChatWorkGetPermitUserListResponse.cs @@ -17,5 +17,5 @@ public class WeChatWorkGetPermitUserListResponse : WeChatWorkResponse [NotNull] [JsonProperty("ids")] [JsonPropertyName("ids")] - public string[] Ids { get; set; } + public string[] Ids { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/CropTagGroup.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/CropTagGroup.cs index db8f9770e..531ca6bc7 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/CropTagGroup.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/CropTagGroup.cs @@ -18,5 +18,5 @@ public class CropTagGroup : TagGroup [NotNull] [JsonProperty("tag")] [JsonPropertyName("tag")] - public CropTag[] Tag { get; set; } + public CropTag[] Tag { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/StrategyTagGroup.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/StrategyTagGroup.cs index 7f49f7e41..c9a0de1e8 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/StrategyTagGroup.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/StrategyTagGroup.cs @@ -18,5 +18,5 @@ public class StrategyTagGroup : TagGroup [NotNull] [JsonProperty("tag")] [JsonPropertyName("tag")] - public StrategyTag[] Tag { get; set; } + public StrategyTag[] Tag { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/Tag.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/Tag.cs index e625fcb66..3cfea2262 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/Tag.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/Tag.cs @@ -11,14 +11,14 @@ public abstract class Tag [NotNull] [JsonProperty("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; /// /// 标签名称 /// [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 标签创建时间 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/TagGroup.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/TagGroup.cs index 6fcd9ddac..d5b24987c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/TagGroup.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Models/TagGroup.cs @@ -11,14 +11,14 @@ public abstract class TagGroup [NotNull] [JsonProperty("group_id")] [JsonPropertyName("group_id")] - public string GroupId { get; set; } + public string GroupId { get; set; } = default!; /// /// 标签组名称 /// [NotNull] [JsonProperty("group_name")] [JsonPropertyName("group_name")] - public string GroupName { get; set; } + public string GroupName { get; set; } = default!; /// /// 标签组创建时间 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkCreateCropTagResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkCreateCropTagResponse.cs index d10cb037d..019468b22 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkCreateCropTagResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkCreateCropTagResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkCreateCropTagResponse : WeChatWorkResponse [NotNull] [JsonProperty("tag_group")] [JsonPropertyName("tag_group")] - public CropTagGroup TagGroup { get; set; } + public CropTagGroup TagGroup { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkCreateStrategyTagResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkCreateStrategyTagResponse.cs index 6f40217d5..568808369 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkCreateStrategyTagResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkCreateStrategyTagResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkCreateStrategyTagResponse : WeChatWorkResponse [NotNull] [JsonProperty("tag_group")] [JsonPropertyName("tag_group")] - public StrategyTagGroup TagGroup { get; set; } + public StrategyTagGroup TagGroup { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkGetCropTagListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkGetCropTagListResponse.cs index b71bcb1a1..ce590e305 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkGetCropTagListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkGetCropTagListResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetCropTagListResponse : WeChatWorkResponse [NotNull] [JsonProperty("tag_group")] [JsonPropertyName("tag_group")] - public StrategyTagGroup[] TagGroup { get; set; } + public StrategyTagGroup[] TagGroup { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkGetStrategyTagListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkGetStrategyTagListResponse.cs index 1a77eaa69..98c0194aa 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkGetStrategyTagListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Tags/Response/WeChatWorkGetStrategyTagListResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetStrategyTagListResponse : WeChatWorkResponse [NotNull] [JsonProperty("tag_group")] [JsonPropertyName("tag_group")] - public StrategyTagGroup[] TagGroup { get; set; } + public StrategyTagGroup[] TagGroup { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/GroupChatTransferFailed.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/GroupChatTransferFailed.cs index a39fb70d4..3baae81a3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/GroupChatTransferFailed.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/GroupChatTransferFailed.cs @@ -14,7 +14,7 @@ public class GroupChatTransferFailed [NotNull] [JsonProperty("chat_id")] [JsonPropertyName("chat_id")] - public string ChatId { get; set; } + public string ChatId { get; set; } = default!; /// /// 没能成功继承的群,错误码 /// @@ -28,5 +28,5 @@ public class GroupChatTransferFailed [NotNull] [JsonProperty("errmsg")] [JsonPropertyName("errmsg")] - public string ErrMsg { get; set; } + public string ErrMsg { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/TransferCustomer.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/TransferCustomer.cs index 3402836b0..020fe57f8 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/TransferCustomer.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/TransferCustomer.cs @@ -11,7 +11,7 @@ public class TransferCustomer [NotNull] [JsonProperty("external_userid")] [JsonPropertyName("external_userid")] - public string ExternalUserid { get; set; } + public string ExternalUserid { get; set; } = default!; /// /// 对此客户进行分配的结果, 具体可参考全局错误码, 0表示成功发起接替,待24小时后自动接替,并不代表最终接替成功 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/TransferCustomerResult.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/TransferCustomerResult.cs index c76f89df7..0f484869d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/TransferCustomerResult.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/TransferCustomerResult.cs @@ -11,7 +11,7 @@ public class TransferCustomerResult [NotNull] [JsonProperty("external_userid")] [JsonPropertyName("external_userid")] - public string ExternalUserid { get; set; } + public string ExternalUserid { get; set; } = default!; /// /// 接替状态 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedCustomerInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedCustomerInfo.cs index f4767e63e..d0189adba 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedCustomerInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedCustomerInfo.cs @@ -11,14 +11,14 @@ public class UnassignedCustomerInfo [NotNull] [JsonProperty("handover_userid")] [JsonPropertyName("handover_userid")] - public string HandoverUserid { get; set; } + public string HandoverUserid { get; set; } = default!; /// /// 外部联系人userid /// [NotNull] [JsonProperty("external_userid")] [JsonPropertyName("external_userid")] - public string ExternalUserid { get; set; } + public string ExternalUserid { get; set; } = default!; /// /// 成员离职时间 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedTransferCustomer.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedTransferCustomer.cs index f8942edf9..bd87cf042 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedTransferCustomer.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedTransferCustomer.cs @@ -14,7 +14,7 @@ public class UnassignedTransferCustomer [NotNull] [JsonProperty("external_userid")] [JsonPropertyName("external_userid")] - public string ExternalUserid { get; set; } + public string ExternalUserid { get; set; } = default!; /// /// 对此客户进行分配的结果,0表示开始分配流程,待24小时后自动接替,并不代表最终分配成功 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedTransferCustomerResult.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedTransferCustomerResult.cs index 8379d2f65..7db32ff70 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedTransferCustomerResult.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Models/UnassignedTransferCustomerResult.cs @@ -14,7 +14,7 @@ public class UnassignedTransferCustomerResult [NotNull] [JsonProperty("external_userid")] [JsonPropertyName("external_userid")] - public string ExternalUserid { get; set; } + public string ExternalUserid { get; set; } = default!; /// /// 接替状态 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetResignedTransferResultResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetResignedTransferResultResponse.cs index 256950e43..0ad440d77 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetResignedTransferResultResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetResignedTransferResultResponse.cs @@ -18,7 +18,7 @@ public class WeChatWorkGetResignedTransferResultResponse : WeChatWorkResponse [NotNull] [JsonProperty("customer")] [JsonPropertyName("customer")] - public UnassignedTransferCustomerResult[] Customer { get; set; } + public UnassignedTransferCustomerResult[] Customer { get; set; } = default!; /// /// 下个分页的起始cursor /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetTransferResultResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetTransferResultResponse.cs index 7aed70bf7..0487ed0ee 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetTransferResultResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetTransferResultResponse.cs @@ -18,7 +18,7 @@ public class WeChatWorkGetTransferResultResponse : WeChatWorkResponse [NotNull] [JsonProperty("customer")] [JsonPropertyName("customer")] - public TransferCustomerResult[] Customer { get; set; } + public TransferCustomerResult[] Customer { get; set; } = default!; /// /// 下个分页的起始cursor /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetUnassignedListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetUnassignedListResponse.cs index 66e42c82b..358db9380 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetUnassignedListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGetUnassignedListResponse.cs @@ -18,7 +18,7 @@ public class WeChatWorkGetUnassignedListResponse : WeChatWorkResponse [NotNull] [JsonProperty("info")] [JsonPropertyName("info")] - public UnassignedCustomerInfo[] Info { get; set; } + public UnassignedCustomerInfo[] Info { get; set; } = default!; /// /// 是否是最后一条记录 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGroupChatOnjobTransferResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGroupChatOnjobTransferResponse.cs index 7f05c077d..f31f6b95e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGroupChatOnjobTransferResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGroupChatOnjobTransferResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGroupChatOnjobTransferResponse : WeChatWorkResponse [NotNull] [JsonProperty("failed_chat_list")] [JsonPropertyName("failed_chat_list")] - public GroupChatTransferFailed[] FailedChatList { get; set; } + public GroupChatTransferFailed[] FailedChatList { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGroupChatTransferResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGroupChatTransferResponse.cs index ad0112bf4..5e82b7714 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGroupChatTransferResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkGroupChatTransferResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGroupChatTransferResponse : WeChatWorkResponse [NotNull] [JsonProperty("failed_chat_list")] [JsonPropertyName("failed_chat_list")] - public GroupChatTransferFailed[] FailedChatList { get; set; } + public GroupChatTransferFailed[] FailedChatList { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkResignedTransferCustomerResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkResignedTransferCustomerResponse.cs index 255fdab7d..8a7a2f896 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkResignedTransferCustomerResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkResignedTransferCustomerResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkResignedTransferCustomerResponse : WeChatWorkResponse [NotNull] [JsonProperty("customer")] [JsonPropertyName("customer")] - public UnassignedTransferCustomer[] Customer { get; set; } + public UnassignedTransferCustomer[] Customer { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkTransferCustomerResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkTransferCustomerResponse.cs index 638d3b4ef..4b426d73d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkTransferCustomerResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Transfers/Response/WeChatWorkTransferCustomerResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkTransferCustomerResponse : WeChatWorkResponse [NotNull] [JsonProperty("customer")] [JsonPropertyName("customer")] - public TransferCustomer[] Customer { get; set; } + public TransferCustomer[] Customer { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Attachments.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Attachments.cs index 509472c1f..08e2f1bd7 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Attachments.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Attachments.cs @@ -26,7 +26,7 @@ internal static partial class HttpClientWeChatWorkRequestExtensions HttpMethod.Post, urlBuilder.ToString()) { - Content = WeChatWorkHttpContentBuildHelper.BuildUploadMediaContent("media", fileBytes, request.Content.FileName) + Content = WeChatWorkHttpContentBuildHelper.BuildUploadMediaContent("media", fileBytes, request.Content.FileName!) }; using var httpResponse = await client.SendAsync(httpRequest, cancellationToken); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyData.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyData.cs index 1adb320f5..4db21947a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyData.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyData.cs @@ -15,7 +15,7 @@ public class ApprovalApplyData [NotNull] [JsonProperty("contents")] [JsonPropertyName("contents")] - public List Contents { get; set; } + public List Contents { get; set; } = default!; public ApprovalApplyData() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyProcess.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyProcess.cs index a04abc150..f0e1b7cfa 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyProcess.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyProcess.cs @@ -15,7 +15,7 @@ public class ApprovalApplyProcess [NotNull] [JsonProperty("node_list")] [JsonPropertyName("node_list")] - public List Nodes { get; set; } + public List Nodes { get; set; } = default!; public ApprovalApplyProcess() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyProcessNode.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyProcessNode.cs index ed04f5a00..12fc64277 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyProcessNode.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalApplyProcessNode.cs @@ -31,7 +31,7 @@ public class ApprovalApplyProcessNode [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; public ApprovalApplyProcessNode() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalComment.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalComment.cs index 9baf9196f..81a52b804 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalComment.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalComment.cs @@ -15,7 +15,7 @@ public class ApprovalComment [CanBeNull] [JsonProperty("commentUserInfo")] [JsonPropertyName("commentUserInfo")] - public ApprovalUser CommentUserInfo { get; set; } + public ApprovalUser? CommentUserInfo { get; set; } /// /// 审批申请提交时间,Unix时间戳 /// @@ -29,19 +29,19 @@ public class ApprovalComment [NotNull] [JsonProperty("commentcontent")] [JsonPropertyName("commentcontent")] - public string CommentContent { get; set; } + public string CommentContent { get; set; } = default!; /// /// 备注id /// [NotNull] [JsonProperty("commentid")] [JsonPropertyName("commentid")] - public string CommentId { get; set; } + public string CommentId { get; set; } = default!; /// /// 备注附件id,可能有多个,微盘文件无法获取 /// [CanBeNull] [JsonProperty("media_id")] [JsonPropertyName("media_id")] - public List MediaId { get; set; } + public List? MediaId { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalControlData.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalControlData.cs index 48cd72b69..93588551a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalControlData.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalControlData.cs @@ -30,14 +30,14 @@ public class ApprovalControlData [NotNull] [JsonProperty("control")] [JsonPropertyName("control")] - public string Control { get; set; } + public string Control { get; set; } = default!; /// /// 控件id:控件的唯一id,可通过“获取审批模板详情”接口获取 /// [NotNull] [JsonProperty("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; /// /// 控件值 ,需在此为申请人在各个控件中填写内容不同控件有不同的赋值参数 /// @@ -47,7 +47,7 @@ public class ApprovalControlData [NotNull] [JsonProperty("value")] [JsonPropertyName("value")] - public ApprovalControlValue Value { get; set; } + public ApprovalControlValue Value { get; set; } = default!; /// /// 控件隐藏标识,为1表示控件被隐藏 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalControlValue.cs index 9add46e96..b78b8ec11 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalControlValue.cs @@ -15,7 +15,7 @@ public class ApprovalControlValue [CanBeNull] [JsonProperty("text")] [JsonPropertyName("text")] - public string Text { get; set; } + public string? Text { get; set; } /// /// 数字内容,即申请人在此控件填写的数字内容 /// @@ -36,42 +36,42 @@ public class ApprovalControlValue [NotNull] [JsonProperty("members")] [JsonPropertyName("members")] - public List Members { get; set; } + public List Members { get; set; } = default!; /// /// 所选部门内容,即申请人在此控件选择的部门,多选模式下可能有多个 /// [NotNull] [JsonProperty("departments")] [JsonPropertyName("departments")] - public List Departments { get; set; } + public List Departments { get; set; } = default!; /// /// 附件列表 /// [NotNull] [JsonProperty("files")] [JsonPropertyName("files")] - public List Files { get; set; } + public List Files { get; set; } = default!; /// /// 明细内容,一个明细控件可能包含多个子明细 /// [NotNull] [JsonProperty("children")] [JsonPropertyName("children")] - public List Children { get; set; } + public List Children { get; set; } = default!; /// /// 选择内容 /// [CanBeNull] [JsonProperty("selector")] [JsonPropertyName("selector")] - public SelectorValue Selector { get; set; } + public SelectorValue? Selector { get; set; } /// /// 关联审批单 /// [NotNull] [JsonProperty("related_approval")] [JsonPropertyName("related_approval")] - public List RelatedApproval { get; set; } + public List RelatedApproval { get; set; } = default!; } public class ApprovalDataChildrenValue @@ -82,5 +82,5 @@ public class ApprovalDataChildrenValue [NotNull] [JsonProperty("list")] [JsonPropertyName("list")] - public List List { get; set; } + public List List { get; set; } = default!; } \ No newline at end of file diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalData.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalData.cs index 9cc249f2d..e87c19646 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalData.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalData.cs @@ -16,7 +16,7 @@ public class ApprovalData [NotNull] [JsonProperty("contents")] [JsonPropertyName("contents")] - public List Contents { get; set; } + public List Contents { get; set; } = default!; public ApprovalData() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalDetailInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalDetailInfo.cs index 585979c18..944110ca3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalDetailInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalDetailInfo.cs @@ -15,14 +15,14 @@ public class ApprovalDetailInfo [NotNull] [JsonProperty("sp_no")] [JsonPropertyName("sp_no")] - public string SpNo { get; set; } + public string SpNo { get; set; } = default!; /// /// 审批申请类型名称(审批模板名称) /// [NotNull] [JsonProperty("sp_name")] [JsonPropertyName("sp_name")] - public string SpName { get; set; } + public string SpName { get; set; } = default!; /// /// 申请单状态 /// @@ -36,7 +36,7 @@ public class ApprovalDetailInfo [NotNull] [JsonProperty("template_id")] [JsonPropertyName("template_id")] - public string TemplateId { get; set; } + public string TemplateId { get; set; } = default!; /// /// 审批申请提交时间,Unix时间戳 /// @@ -50,47 +50,47 @@ public class ApprovalDetailInfo [CanBeNull] [JsonProperty("applyer")] [JsonPropertyName("applyer")] - public ApprovalApplyer Applyer { get; set; } + public ApprovalApplyer? Applyer { get; set; } /// /// 批量申请人信息(和applyer字段互斥) /// [CanBeNull] [JsonProperty("batch_applyer")] [JsonPropertyName("batch_applyer")] - public List BatchApplyer { get; set; } + public List? BatchApplyer { get; set; } /// /// 审批流程信息,可能有多个审批节点 /// [NotNull] [JsonProperty("sp_record")] [JsonPropertyName("sp_record")] - public List SpRecord { get; set; } + public List SpRecord { get; set; } = default!; /// /// 抄送信息,可能有多个抄送节点 /// [CanBeNull] [JsonProperty("notifyer")] [JsonPropertyName("notifyer")] - public List Notifyer { get; set; } + public List? Notifyer { get; set; } /// /// 审批申请数据 /// [NotNull] [JsonProperty("apply_data")] [JsonPropertyName("apply_data")] - public ApprovalData ApplyData { get; set; } + public ApprovalData ApplyData { get; set; } = default!; /// /// 审批申请备注信息,可能有多个备注节点 /// [NotNull] [JsonProperty("comments")] [JsonPropertyName("comments")] - public List Comments { get; set; } + public List Comments { get; set; } = default!; /// /// 审批流程列表 /// [NotNull] [JsonProperty("process_list")] [JsonPropertyName("process_list")] - public ApprovalProcess Process { get; set; } + public ApprovalProcess Process { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcess.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcess.cs index d9754dfb0..937469f08 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcess.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcess.cs @@ -15,5 +15,5 @@ public class ApprovalProcess [NotNull] [JsonProperty("node_list")] [JsonPropertyName("node_list")] - public List Nodes { get; set; } + public List Nodes { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcessNode.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcessNode.cs index acba46fa8..f83f2d9c7 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcessNode.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcessNode.cs @@ -36,5 +36,5 @@ public class ApprovalProcessNode [CanBeNull] [JsonProperty("sub_node_list")] [JsonPropertyName("sub_node_list")] - public List SubNodes { get; set; } + public List? SubNodes { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcessSubNode.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcessSubNode.cs index 834daa229..3ee80768d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcessSubNode.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalProcessSubNode.cs @@ -15,14 +15,14 @@ public class ApprovalProcessSubNode [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 审批/办理意见 /// [NotNull] [JsonProperty("speech")] [JsonPropertyName("speech")] - public string Speech { get; set; } + public string Speech { get; set; } = default!; /// /// 子节点状态 1-审批中;2-同意;3-驳回;4-转审;11-退回给指定审批人;12-加签;13-同意并加签;14-办理;15-转交 /// @@ -43,5 +43,5 @@ public class ApprovalProcessSubNode [CanBeNull] [JsonProperty("media_ids")] [JsonPropertyName("media_ids")] - public List MediaIds { get; set; } + public List? MediaIds { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSpRecord.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSpRecord.cs index 8f7bede1b..9b8b4bfed 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSpRecord.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSpRecord.cs @@ -29,5 +29,5 @@ public class ApprovalSpRecord [NotNull] [JsonProperty("details")] [JsonPropertyName("details")] - public List Details { get; set; } + public List Details { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSpRecordDetail.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSpRecordDetail.cs index 9ad8e2d3c..abe17fc06 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSpRecordDetail.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSpRecordDetail.cs @@ -15,14 +15,14 @@ public class ApprovalSpRecordDetail [NotNull] [JsonProperty("approver")] [JsonPropertyName("approver")] - public ApprovalUser Approver { get; set; } + public ApprovalUser Approver { get; set; } = default!; /// /// 审批意见 /// [NotNull] [JsonProperty("speech")] [JsonPropertyName("speech")] - public string Speech { get; set; } + public string Speech { get; set; } = default!; /// /// 分支审批人审批状态 /// @@ -43,5 +43,5 @@ public class ApprovalSpRecordDetail [CanBeNull] [JsonProperty("media_id")] [JsonPropertyName("media_id")] - public List MediaId { get; set; } + public List? MediaId { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSummary.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSummary.cs index 1306e82c9..c7092d6b0 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSummary.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSummary.cs @@ -15,7 +15,7 @@ public class ApprovalSummary [NotNull] [JsonProperty("summary_info")] [JsonPropertyName("summary_info")] - public List SummaryInfo { get; set; } + public List SummaryInfo { get; set; } = default!; public ApprovalSummary() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSummaryInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSummaryInfo.cs index 6dca2bcf1..18d0d2145 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSummaryInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalSummaryInfo.cs @@ -16,7 +16,7 @@ public class ApprovalSummaryInfo [StringLength(20)] [JsonProperty("text")] [JsonPropertyName("text")] - public string Text { get; set; } + public string Text { get; set; } = default!; /// /// 摘要行显示语言,中文:zh_CN(注意不是zh-CN),英文:en。 /// @@ -24,7 +24,7 @@ public class ApprovalSummaryInfo [StringLength(30)] [JsonProperty("lang")] [JsonPropertyName("lang")] - public string Lang { get; set; } + public string Lang { get; set; } = default!; public ApprovalSummaryInfo() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalUser.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalUser.cs index 6b7acb474..87826558e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalUser.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ApprovalUser.cs @@ -14,5 +14,5 @@ public class ApprovalUser [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/AttendanceControlConfig.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/AttendanceControlConfig.cs index b722885e7..40e32871b 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/AttendanceControlConfig.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/AttendanceControlConfig.cs @@ -14,7 +14,7 @@ public class AttendanceControlConfig : ControlConfig [NotNull] [JsonProperty("attendance")] [JsonPropertyName("attendance")] - public AttendanceConfig Attendance { get; set; } + public AttendanceConfig Attendance { get; set; } = default!; public AttendanceControlConfig() { @@ -41,7 +41,7 @@ public class AttendanceConfig [NotNull] [JsonProperty("date_range")] [JsonPropertyName("date_range")] - public DateRangeConfig DateRange { get; set; } + public DateRangeConfig DateRange { get; set; } = default!; public AttendanceConfig() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/AttendanceControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/AttendanceControlValue.cs index 415104d53..847924278 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/AttendanceControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/AttendanceControlValue.cs @@ -15,7 +15,7 @@ public class AttendanceControlValue : ControlValue [NotNull] [JsonProperty("attendance")] [JsonPropertyName("attendance")] - public AttendanceValue Attendance { get; set; } + public AttendanceValue Attendance { get; set; } = default!; public AttendanceControlValue() { @@ -35,7 +35,7 @@ public class AttendanceValue [NotNull] [JsonProperty("date_range")] [JsonPropertyName("date_range")] - public DateRangeValue DateRange { get; set; } + public DateRangeValue DateRange { get; set; } = default!; /// /// 假勤组件类型:1-请假;3-出差;4-外出;5-加班 /// @@ -49,7 +49,7 @@ public class AttendanceValue [CanBeNull] [JsonProperty("slice_info")] [JsonPropertyName("slice_info")] - public AttendanceSliceInfo SliceInfo { get; set; } + public AttendanceSliceInfo? SliceInfo { get; set; } } public class AttendanceSliceInfo @@ -67,7 +67,7 @@ public class AttendanceSliceInfo [NotNull] [JsonProperty("day_items")] [JsonPropertyName("day_items")] - public List DayItems { get; set; } + public List DayItems { get; set; } = default!; public AttendanceSliceInfo() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ContactControlConfig.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ContactControlConfig.cs index 354c050cb..a3a7e5b67 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ContactControlConfig.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ContactControlConfig.cs @@ -14,7 +14,7 @@ public class ContactControlConfig : ControlConfig [NotNull] [JsonProperty("contact")] [JsonPropertyName("contact")] - public ContactConfig Contact { get; set; } + public ContactConfig Contact { get; set; } = default!; public ContactControlConfig() { @@ -34,14 +34,14 @@ public class ContactConfig [NotNull] [JsonProperty("type")] [JsonPropertyName("type")] - public string Type { get; set; } + public string Type { get; set; } = default!; /// /// user-成员、department-部门 /// [NotNull] [JsonProperty("mode")] [JsonPropertyName("mode")] - public string Mode { get; set; } + public string Mode { get; set; } = default!; public ContactConfig() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/Control.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/Control.cs index aa8b4666d..e68b5a0b0 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/Control.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/Control.cs @@ -16,12 +16,12 @@ public class Control [NotNull] [JsonProperty("property")] [JsonPropertyName("property")] - public ControlInfo Property { get; set; } + public ControlInfo Property { get; set; } = default!; /// /// 控件配置 /// [CanBeNull] [JsonProperty("config")] [JsonPropertyName("config")] - public ControlConfig Config { get; set; } + public ControlConfig? Config { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlData.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlData.cs index 629d75439..b5405dabc 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlData.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlData.cs @@ -30,14 +30,14 @@ public class ControlData [NotNull] [JsonProperty("control")] [JsonPropertyName("control")] - public string Control { get; set; } + public string Control { get; set; } = default!; /// /// 控件id:控件的唯一id,可通过“获取审批模板详情”接口获取 /// [NotNull] [JsonProperty("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; /// /// 控件值 ,需在此为申请人在各个控件中填写内容不同控件有不同的赋值参数 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlInfo.cs index 7282d95cf..40ff69b0e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlInfo.cs @@ -15,7 +15,7 @@ public class ControlInfo [NotNull] [JsonProperty("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public string Id { get; set; } = default!; /// /// 控件类型 /// @@ -42,21 +42,21 @@ public class ControlInfo [NotNull] [JsonProperty("control")] [JsonPropertyName("control")] - public string Control { get; set; } + public string Control { get; set; } = default!; /// /// 控件名称 /// [NotNull] [JsonProperty("title")] [JsonPropertyName("title")] - public List Title { get; set; } + public List Title { get; set; } = default!; /// /// 控件说明,假勤组件(Vacation、Attendance)暂不支持设置 /// [CanBeNull] [JsonProperty("placeholder")] [JsonPropertyName("placeholder")] - public List Placeholder { get; set; } + public List? Placeholder { get; set; } /// /// 控件是否必填。0-非必填;1-必填;默认为0;假勤组件(Vacation、Attendance)不支持设置非必填 /// @@ -84,7 +84,7 @@ public class ControlInfo [CanBeNull] [JsonProperty("inner_id")] [JsonPropertyName("inner_id")] - public string InnerId { get; set; } + public string? InnerId { get; set; } /// /// 控件是否隐藏 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlPlaceholder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlPlaceholder.cs index d74560c22..84e335a0c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlPlaceholder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlPlaceholder.cs @@ -16,14 +16,14 @@ public class ControlPlaceholder [StringLength(80)] [JsonProperty("text")] [JsonPropertyName("text")] - public string Text { get; set; } + public string Text { get; set; } = default!; /// /// 显示语言,中文:zh_CN(注意不是zh-CN);若text填写,则该项为必填 /// [NotNull] [JsonProperty("lang")] [JsonPropertyName("lang")] - public string Lang { get; set; } + public string Lang { get; set; } = default!; public ControlPlaceholder() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlTtile.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlTtile.cs index 4afa9fdfc..df0905b60 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlTtile.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/ControlTtile.cs @@ -16,14 +16,14 @@ public class ControlTtile [StringLength(40)] [JsonProperty("text")] [JsonPropertyName("text")] - public string Text { get; set; } + public string Text { get; set; } = default!; /// /// 显示语言,中文:zh_CN(注意不是zh-CN) /// [NotNull] [JsonProperty("lang")] [JsonPropertyName("lang")] - public string Lang { get; set; } + public string Lang { get; set; } = default!; public ControlTtile() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateControlConfig.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateControlConfig.cs index 26328b264..a0af7ed50 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateControlConfig.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateControlConfig.cs @@ -14,7 +14,7 @@ public class DateControlConfig : ControlConfig [NotNull] [JsonProperty("date")] [JsonPropertyName("date")] - public DateConfig Date { get; set; } + public DateConfig Date { get; set; } = default!; public DateControlConfig() { @@ -34,5 +34,5 @@ public class DateConfig [NotNull] [JsonProperty("type")] [JsonPropertyName("type")] - public string Type { get; set; } + public string Type { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateControlValue.cs index 756a34edd..ec18ab205 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateControlValue.cs @@ -14,7 +14,7 @@ public class DateControlValue : ControlValue [NotNull] [JsonProperty("date")] [JsonPropertyName("date")] - public DateValue Date { get; set; } + public DateValue Date { get; set; } = default!; public DateControlValue() { @@ -34,14 +34,14 @@ public class DateValue [NotNull] [JsonProperty("type")] [JsonPropertyName("type")] - public string Type { get; set; } + public string Type { get; set; } = default!; /// /// 时间戳-字符串类型,在此填写日期/日期+时间控件的选择值,以此为准 /// [NotNull] [JsonProperty("s_timestamp")] [JsonPropertyName("s_timestamp")] - public string Timestamp { get; set; } + public string Timestamp { get; set; } = default!; public DateValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeConfig.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeConfig.cs index 832400662..2244473bd 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeConfig.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeConfig.cs @@ -14,7 +14,7 @@ public class DateRangeConfig [NotNull] [JsonProperty("type")] [JsonPropertyName("type")] - public string Type { get; set; } + public string Type { get; set; } = default!; /// /// 0-自然日;1-工作日 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeControlConfig.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeControlConfig.cs index cbed0a935..4d847a0f6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeControlConfig.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeControlConfig.cs @@ -14,7 +14,7 @@ public class DateRangeControlConfig : ControlConfig [NotNull] [JsonProperty("date_range")] [JsonPropertyName("date_range")] - public DateRangeConfig DateRange { get; set; } + public DateRangeConfig DateRange { get; set; } = default!; public DateRangeControlConfig() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeControlValue.cs index 63428b18a..3355b7ea8 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DateRangeControlValue.cs @@ -14,7 +14,7 @@ public class DateRangeControlValue : ControlValue [NotNull] [JsonProperty("date_range")] [JsonPropertyName("date_range")] - public DateRangeValue DateRange { get; set; } + public DateRangeValue DateRange { get; set; } = default!; public DateRangeControlValue() { @@ -34,14 +34,14 @@ public class DateRangeValue [NotNull] [JsonProperty("type")] [JsonPropertyName("type")] - public string Type { get; set; } + public string Type { get; set; } = default!; /// /// 开始时间,unix时间戳。当type 为halfday时,取值只能为固定两个时间点 上午:当天00:00:00点时间戳 下午:当天12:00:00时间戳 /// [NotNull] [JsonProperty("new_begin")] [JsonPropertyName("new_begin")] - public long NewBegin { get; set; } + public long NewBegin { get; set; } = default!; /// /// 结束时间,unix时间戳。 当type 为halfday时,取值只能为固定两个时间点 上午:当天00:00:00点时间戳 下午:当天12:00:00时间戳 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DepartmentControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DepartmentControlValue.cs index 083857aa0..130dd837e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DepartmentControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/DepartmentControlValue.cs @@ -15,7 +15,7 @@ public class DepartmentControlValue : ContactControlValue [NotNull] [JsonProperty("departments")] [JsonPropertyName("departments")] - public List Departments { get; set; } + public List Departments { get; set; } = default!; public DepartmentControlValue() { @@ -45,14 +45,14 @@ public class DepartmentValue [NotNull] [JsonProperty("openapi_id")] [JsonPropertyName("openapi_id")] - public string DepartmentId { get; set; } + public string DepartmentId { get; set; } = default!; /// /// 所选部门名 /// [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; public DepartmentValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FileControlConfig.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FileControlConfig.cs index 587ba1fc7..f6a50798c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FileControlConfig.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FileControlConfig.cs @@ -14,7 +14,7 @@ public class FileControlConfig : ControlConfig [NotNull] [JsonProperty("file")] [JsonPropertyName("file")] - public FileConfig File { get; set; } + public FileConfig File { get; set; } = default!; public FileControlConfig() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FileControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FileControlValue.cs index 2eae6e0cf..c6d2cfbcd 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FileControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FileControlValue.cs @@ -15,7 +15,7 @@ public class FileControlValue : ControlValue [NotNull] [JsonProperty("files")] [JsonPropertyName("files")] - public List Files { get; set; } + public List Files { get; set; } = default!; public FileControlValue() { @@ -35,14 +35,14 @@ public class FileValue [NotNull] [JsonProperty("file_id")] [JsonPropertyName("file_id")] - public string FileId { get; set; } + public string FileId { get; set; } = default!; /// /// 文件名称,类型为string,如果没有可以填空字符串。 /// [CanBeNull] [JsonProperty("file_name")] [JsonPropertyName("file_name")] - public string FileName { get; set; } + public string? FileName { get; set; } /// /// 文件大小,类型为number,如果没有可以填空字符串。 /// @@ -56,14 +56,14 @@ public class FileValue [CanBeNull] [JsonProperty("file_type")] [JsonPropertyName("file_type")] - public string FileType { get; set; } + public string? FileType { get; set; } /// /// 文件地址,类型为string,如果没有可以填空字符串。 /// [CanBeNull] [JsonProperty("file_url")] [JsonPropertyName("file_url")] - public string FileUrl { get; set; } + public string? FileUrl { get; set; } public FileValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FormulaControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FormulaControlValue.cs index 0f380b871..68e47d915 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FormulaControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/FormulaControlValue.cs @@ -14,7 +14,7 @@ public class FormulaControlValue : ControlValue [NotNull] [JsonProperty("formula")] [JsonPropertyName("formula")] - public FormulaValue Formula { get; set; } + public FormulaValue Formula { get; set; } = default!; public FormulaControlValue() { @@ -34,7 +34,7 @@ public class FormulaValue [NotNull] [JsonProperty("value")] [JsonPropertyName("value")] - public string Value { get; set; } + public string Value { get; set; } = default!; public FormulaValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/LocationControlConfig.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/LocationControlConfig.cs index e3715c7b8..e1bcad08c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/LocationControlConfig.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/LocationControlConfig.cs @@ -14,7 +14,7 @@ public class LocationControlConfig : ControlConfig [NotNull] [JsonProperty("location")] [JsonPropertyName("location")] - public LocationConfig Location { get; set; } + public LocationConfig Location { get; set; } = default!; public LocationControlConfig() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/LocationControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/LocationControlValue.cs index b53d31519..b52ce4c15 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/LocationControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/LocationControlValue.cs @@ -14,7 +14,7 @@ public class LocationControlValue : ControlValue [NotNull] [JsonProperty("location")] [JsonPropertyName("location")] - public LocationValue Location { get; set; } + public LocationValue Location { get; set; } = default!; public LocationControlValue() { @@ -48,14 +48,14 @@ public class LocationValue [NotNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string Title { get; set; } = default!; /// /// 地点详情地址 /// [NotNull] [JsonProperty("address")] [JsonPropertyName("address")] - public string Address { get; set; } + public string Address { get; set; } = default!; /// /// 选择地点的时间 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/MemberControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/MemberControlValue.cs index 8b7ac793e..98a7fe3fc 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/MemberControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/MemberControlValue.cs @@ -15,7 +15,7 @@ public class MemberControlValue : ContactControlValue [NotNull] [JsonProperty("members")] [JsonPropertyName("members")] - public List Members { get; set; } + public List Members { get; set; } = default!; public MemberControlValue() { @@ -45,14 +45,14 @@ public class MemberValue [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 成员名 /// [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; public MemberValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/MoneyControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/MoneyControlValue.cs index b3b0636a4..70b82fcd5 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/MoneyControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/MoneyControlValue.cs @@ -14,7 +14,7 @@ public class MoneyControlValue : ControlValue [NotNull] [JsonProperty("new_money")] [JsonPropertyName("new_money")] - public string NewMoney { get; set; } + public string NewMoney { get; set; } = default!; public MoneyControlValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/NumberControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/NumberControlValue.cs index 62c04f3a9..0b40e088f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/NumberControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/NumberControlValue.cs @@ -14,7 +14,7 @@ public class NumberControlValue : ControlValue [NotNull] [JsonProperty("new_number")] [JsonPropertyName("new_number")] - public string NewMumber { get; set; } + public string NewMumber { get; set; } = default!; public NumberControlValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/RelatedApprovalControlConfig.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/RelatedApprovalControlConfig.cs index 652a31673..4dcd09270 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/RelatedApprovalControlConfig.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/RelatedApprovalControlConfig.cs @@ -14,7 +14,7 @@ public class RelatedApprovalControlConfig : ControlConfig [NotNull] [JsonProperty("related_approval")] [JsonPropertyName("related_approval")] - public RelatedApprovalConfig RelatedApproval { get; set; } + public RelatedApprovalConfig RelatedApproval { get; set; } = default!; public RelatedApprovalControlConfig() { @@ -34,7 +34,7 @@ public class RelatedApprovalConfig [NotNull] [JsonProperty("template_id")] [JsonPropertyName("template_id")] - public string TemplateId { get; set; } + public string TemplateId { get; set; } = default!; public RelatedApprovalConfig() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/RelatedApprovalControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/RelatedApprovalControlValue.cs index 81ead0067..2e429c9c7 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/RelatedApprovalControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/RelatedApprovalControlValue.cs @@ -14,7 +14,7 @@ public class RelatedApprovalControlValue : ControlValue [NotNull] [JsonProperty("related_approval")] [JsonPropertyName("related_approval")] - public RelatedApprovalValue RelatedApproval { get; set; } + public RelatedApprovalValue RelatedApproval { get; set; } = default!; public RelatedApprovalControlValue() { @@ -35,7 +35,7 @@ public class RelatedApprovalValue [NotNull] [JsonProperty("sp_no")] [JsonPropertyName("sp_no")] - public string SpNo { get; set; } + public string SpNo { get; set; } = default!; public RelatedApprovalValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/SelectorControlConfig.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/SelectorControlConfig.cs index 993a258ad..202d40c54 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/SelectorControlConfig.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/SelectorControlConfig.cs @@ -15,7 +15,7 @@ public class SelectorControlConfig : ControlConfig [NotNull] [JsonProperty("selector")] [JsonPropertyName("selector")] - public SelectorConfig Selector { get; set; } + public SelectorConfig Selector { get; set; } = default!; public SelectorControlConfig() { @@ -35,14 +35,14 @@ public class SelectorConfig [NotNull] [JsonProperty("type")] [JsonPropertyName("type")] - public string Type { get; set; } + public string Type { get; set; } = default!; /// /// 多选选项,多选属性的选择控件允许输入多个 /// [CanBeNull] [JsonProperty("options")] [JsonPropertyName("options")] - public List Options { get; set; } + public List? Options { get; set; } /// /// 关联控件 /// @@ -99,14 +99,14 @@ public class SelectorOption [NotNull] [JsonProperty("key")] [JsonPropertyName("key")] - public string Key { get; set; } + public string Key { get; set; } = default!; /// /// 选项说明 /// [NotNull] [JsonProperty("value")] [JsonPropertyName("value")] - public List Value { get; set; } + public List Value { get; set; } = default!; public SelectorOption() { @@ -127,14 +127,14 @@ public class SelectorOptionValue [NotNull] [JsonProperty("text")] [JsonPropertyName("text")] - public string Text { get; set; } + public string Text { get; set; } = default!; /// /// 显示语言 /// [NotNull] [JsonProperty("lang")] [JsonPropertyName("lang")] - public string Lang { get; set; } + public string Lang { get; set; } = default!; public SelectorOptionValue() { @@ -155,14 +155,14 @@ public class SelectorOptionRelation [NotNull] [JsonProperty("key")] [JsonPropertyName("key")] - public string Key { get; set; } + public string Key { get; set; } = default!; /// /// 关联控件列表 /// [NotNull] [JsonProperty("relation_list")] [JsonPropertyName("relation_list")] - public List Relations { get; set; } + public List Relations { get; set; } = default!; public SelectorOptionRelation() { @@ -183,7 +183,7 @@ public class SelectorRelation [NotNull] [JsonProperty("related_control_id")] [JsonPropertyName("related_control_id")] - public string ControlId { get; set; } + public string ControlId { get; set; } = default!; /// /// 操作方法 /// @@ -193,7 +193,7 @@ public class SelectorRelation [NotNull] [JsonProperty("action")] [JsonPropertyName("action")] - public int Action { get; set; } + public int Action { get; set; } = default!; public SelectorRelation() { @@ -221,7 +221,7 @@ public class SelectorOptionExternal [NotNull] [JsonProperty("external_url")] [JsonPropertyName("external_url")] - public string ExternalUrl { get; set; } + public string ExternalUrl { get; set; } = default!; public SelectorOptionExternal() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/SelectorControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/SelectorControlValue.cs index 458c3e7cb..4907f879f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/SelectorControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/SelectorControlValue.cs @@ -16,7 +16,7 @@ public class SelectorControlValue : ControlValue [NotNull] [JsonProperty("selector")] [JsonPropertyName("selector")] - public SelectorValue Selector { get; set; } + public SelectorValue Selector { get; set; } = default!; public SelectorControlValue() { @@ -36,14 +36,14 @@ public class SelectorValue [NotNull] [JsonProperty("type")] [JsonPropertyName("type")] - public string Type { get; set; } + public string Type { get; set; } = default!; /// /// 多选选项,多选属性的选择控件允许输入多个 /// [NotNull] [JsonProperty("options")] [JsonPropertyName("options")] - public List Options { get; set; } + public List Options { get; set; } = default!; public SelectorValue() { @@ -83,14 +83,14 @@ public class SelectorValueOption [NotNull] [JsonProperty("key")] [JsonPropertyName("key")] - public string Key { get; set; } + public string Key { get; set; } = default!; /// /// 选项值,若配置了多语言则会包含中英文的选项值 /// [NotNull] [JsonProperty("value")] [JsonPropertyName("value")] - public List Value { get; set; } + public List Value { get; set; } = default!; public SelectorValueOption() { @@ -112,14 +112,14 @@ public class SelectorValueOptionValue [StringLength(40)] [JsonProperty("text")] [JsonPropertyName("text")] - public string Text { get; set; } + public string Text { get; set; } = default!; /// /// 多语言名称 /// [NotNull] [JsonProperty("lang")] [JsonPropertyName("lang")] - public string Lang { get; set; } + public string Lang { get; set; } = default!; public SelectorValueOptionValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TableControlConfig.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TableControlConfig.cs index 62e5ad24e..f7212cd79 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TableControlConfig.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TableControlConfig.cs @@ -15,7 +15,7 @@ public class TableControlConfig : ControlConfig [NotNull] [JsonProperty("table")] [JsonPropertyName("table")] - public TableConfig Table { get; set; } + public TableConfig Table { get; set; } = default!; public TableControlConfig() { @@ -42,7 +42,7 @@ public class TableConfig [NotNull] [JsonProperty("children")] [JsonPropertyName("children")] - public List Children { get; set; } + public List Children { get; set; } = default!; public TableConfig() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TableControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TableControlValue.cs index 9d558db26..864066257 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TableControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TableControlValue.cs @@ -15,7 +15,7 @@ public class TableControlValue : ControlValue [NotNull] [JsonProperty("children")] [JsonPropertyName("children")] - public List Children { get; set; } + public List Children { get; set; } = default!; public TableControlValue() { @@ -38,7 +38,7 @@ public class TableValue [NotNull] [JsonProperty("list")] [JsonPropertyName("list")] - public List List { get; set; } + public List List { get; set; } = default!; public TableValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TemplateContent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TemplateContent.cs index edcd717f5..ed1802c2b 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TemplateContent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TemplateContent.cs @@ -15,5 +15,5 @@ public class TemplateContent [NotNull] [JsonProperty("controls")] [JsonPropertyName("controls")] - public List Controls { get; set; } + public List Controls { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TemplateName.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TemplateName.cs index 474d42b3a..aa8042282 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TemplateName.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TemplateName.cs @@ -14,14 +14,14 @@ public class TemplateName [NotNull] [JsonProperty("text")] [JsonPropertyName("text")] - public string Text { get; set; } + public string Text { get; set; } = default!; /// /// 多语言名称 /// [NotNull] [JsonProperty("lang")] [JsonPropertyName("lang")] - public string Lang { get; set; } + public string Lang { get; set; } = default!; public TemplateName() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TextControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TextControlValue.cs index 9858dac31..fc391f6d4 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TextControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TextControlValue.cs @@ -14,7 +14,7 @@ public class TextControlValue : ControlValue [NotNull] [JsonProperty("text")] [JsonPropertyName("text")] - public string Text { get; set; } + public string Text { get; set; } = default!; public TextControlValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TextareaControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TextareaControlValue.cs index 221474f41..141649046 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TextareaControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TextareaControlValue.cs @@ -14,7 +14,7 @@ public class TextareaControlValue : ControlValue [NotNull] [JsonProperty("text")] [JsonPropertyName("text")] - public string Text { get; set; } + public string Text { get; set; } = default!; public TextareaControlValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TipsControlConfig.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TipsControlConfig.cs index 88904cd96..e85bcc4ee 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TipsControlConfig.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/TipsControlConfig.cs @@ -16,7 +16,7 @@ public class TipsControlConfig : ControlConfig [NotNull] [JsonProperty("tips")] [JsonPropertyName("tips")] - public TipsConfig Tips { get; set; } + public TipsConfig Tips { get; set; } = default!; public TipsControlConfig() { @@ -36,7 +36,7 @@ public class TipsConfig [NotNull] [JsonProperty("tips_content")] [JsonPropertyName("tips_content")] - public List TipsContents { get; set; } + public List TipsContents { get; set; } = default!; public TipsConfig() { @@ -56,14 +56,14 @@ public class TipsContent [NotNull] [JsonProperty("text")] [JsonPropertyName("text")] - public TipsContentText Text { get; set; } + public TipsContentText Text { get; set; } = default!; /// /// 多语言名称 /// [NotNull] [JsonProperty("lang")] [JsonPropertyName("lang")] - public string Lang { get; set; } + public string Lang { get; set; } = default!; public TipsContent() { @@ -84,7 +84,7 @@ public class TipsContentText [NotNull] [JsonProperty("sub_text")] [JsonPropertyName("sub_text")] - public List SubText { get; set; } + public List SubText { get; set; } = default!; public TipsContentText() { @@ -111,7 +111,7 @@ public class TipsContentSubText [NotNull] [JsonProperty("content")] [JsonPropertyName("content")] - public SubTextContent Content { get; set; } + public SubTextContent Content { get; set; } = default!; public TipsContentSubText() { @@ -146,7 +146,7 @@ public class TipsContentPlainText : SubTextContent [NotNull] [JsonProperty("content")] [JsonPropertyName("content")] - public string Content { get; set; } + public string Content { get; set; } = default!; } public class TipsContentLinkText : SubTextContent @@ -157,7 +157,7 @@ public class TipsContentLinkText : SubTextContent [NotNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string Title { get; set; } = default!; /// /// 链接url,不能超过600个字符 /// @@ -165,5 +165,5 @@ public class TipsContentLinkText : SubTextContent [StringLength(600)] [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string Url { get; set; } = default!; } \ No newline at end of file diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/VacationControlValue.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/VacationControlValue.cs index bff3ec282..b720134bf 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/VacationControlValue.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Models/VacationControlValue.cs @@ -15,7 +15,7 @@ public class VacationControlValue : ControlValue [NotNull] [JsonProperty("vacation")] [JsonPropertyName("vacation")] - public VacationValue Vacation { get; set; } + public VacationValue Vacation { get; set; } = default!; public VacationControlValue() { @@ -35,14 +35,14 @@ public class VacationValue [NotNull] [JsonProperty("selector")] [JsonPropertyName("selector")] - public VacationSelector Selector { get; set; } + public VacationSelector Selector { get; set; } = default!; /// /// 假勤组件 /// [NotNull] [JsonProperty("attendance")] [JsonPropertyName("attendance")] - public AttendanceValue Attendance { get; set; } + public AttendanceValue Attendance { get; set; } = default!; public VacationValue() { @@ -63,14 +63,14 @@ public class VacationSelector [NotNull] [JsonProperty("type")] [JsonPropertyName("type")] - public string Type { get; set; } + public string Type { get; set; } = default!; /// /// 用户所选选项 /// [NotNull] [JsonProperty("options")] [JsonPropertyName("options")] - public List Options { get; set; } + public List Options { get; set; } = default!; public VacationSelector() { @@ -91,14 +91,14 @@ public class VacationSelectorOption [NotNull] [JsonProperty("key")] [JsonPropertyName("key")] - public string Key { get; set; } + public string Key { get; set; } = default!; /// /// 选项值,若配置了多语言则会包含中英文的选项值 /// [NotNull] [JsonProperty("value")] [JsonPropertyName("value")] - public VacationSelectorOptionValue Value { get; set; } + public VacationSelectorOptionValue Value { get; set; } = default!; public VacationSelectorOption() { @@ -119,14 +119,14 @@ public class VacationSelectorOptionValue [NotNull] [JsonProperty("text")] [JsonPropertyName("text")] - public string Text { get; set; } + public string Text { get; set; } = default!; /// /// 多语言名称 /// [NotNull] [JsonProperty("lang")] [JsonPropertyName("lang")] - public string Lang { get; set; } + public string Lang { get; set; } = default!; public VacationSelectorOptionValue() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Request/WeChatWorkApplyEventRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Request/WeChatWorkApplyEventRequest.cs index 47206978c..3a0e1e5f1 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Request/WeChatWorkApplyEventRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Request/WeChatWorkApplyEventRequest.cs @@ -26,10 +26,10 @@ public class WeChatWorkApplyEventRequest : WeChatWorkRequest /// /// 摘要信息,用于显示在审批通知卡片、审批列表的摘要信息,最多3行 /// - [NotNull] + [CanBeNull] [JsonProperty("summary_list")] [JsonPropertyName("summary_list")] - public List Summaries { get; set; } + public List? Summaries { get; set; } /// /// 审批申请数据,可定义审批申请中各个控件的值,其中必填项必须有值,选填项可为空,数据结构同“获取审批申请详情”接口返回值中同名参数“apply_data” /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkApplyEventResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkApplyEventResponse.cs index 0157def9a..f944f3a70 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkApplyEventResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkApplyEventResponse.cs @@ -17,5 +17,5 @@ public class WeChatWorkApplyEventResponse : WeChatWorkResponse [NotNull] [JsonProperty("sp_no")] [JsonPropertyName("sp_no")] - public string SpNo { get; set; } + public string SpNo { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkCreateTemplateResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkCreateTemplateResponse.cs index b867a97e5..f7c141bfc 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkCreateTemplateResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkCreateTemplateResponse.cs @@ -17,5 +17,5 @@ public class WeChatWorkCreateTemplateResponse : WeChatWorkResponse [NotNull] [JsonProperty("template_id")] [JsonPropertyName("template_id")] - public string TemplateId { get; set; } + public string TemplateId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkGetApprovalDetailResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkGetApprovalDetailResponse.cs index 76be8549f..1dcccc69b 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkGetApprovalDetailResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkGetApprovalDetailResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetApprovalDetailResponse : WeChatWorkResponse [NotNull] [JsonProperty("info")] [JsonPropertyName("info")] - public ApprovalDetailInfo Info { get; set; } + public ApprovalDetailInfo Info { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkGetApprovalInfoResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkGetApprovalInfoResponse.cs index 6e8f90ef7..f00abc32c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkGetApprovalInfoResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkGetApprovalInfoResponse.cs @@ -18,12 +18,12 @@ public class WeChatWorkGetApprovalInfoResponse : WeChatWorkResponse [NotNull] [JsonProperty("sp_no_list")] [JsonPropertyName("sp_no_list")] - public List SpNos { get; set; } + public List SpNos { get; set; } = default!; /// /// 后续请求查询的游标,当返回结果没有该字段时表示审批单已经拉取完 /// [CanBeNull] [JsonProperty("new_next_cursor")] [JsonPropertyName("new_next_cursor")] - public string NewNextCursor { get; set; } + public string? NewNextCursor { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkTemplateResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkTemplateResponse.cs index 3ed2478fb..79b762d22 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkTemplateResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Approvals/Response/WeChatWorkTemplateResponse.cs @@ -19,14 +19,14 @@ public class WeChatWorkTemplateResponse : WeChatWorkResponse [NotNull] [JsonProperty("template_names")] [JsonPropertyName("template_names")] - public List TemplateNames { get; set; } + public List TemplateNames { get; set; } = default!; /// /// 审批模版控件设置,由多个表单控件及其内容组成,其中包含需要对控件赋值的信息 /// [NotNull] [JsonProperty("template_content")] [JsonPropertyName("template_content")] - public TemplateContent TemplateContent { get; set; } + public TemplateContent TemplateContent { get; set; } = default!; public WeChatWorkTemplateResponse() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomBookingInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomBookingInfo.cs index cff9e92a6..9e5ffa830 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomBookingInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomBookingInfo.cs @@ -21,5 +21,5 @@ public class MeetingRoomBookingInfo [NotNull] [JsonProperty("schedule")] [JsonPropertyName("schedule")] - public MeetingRoomSchedule[] Schedule { get; set; } + public MeetingRoomSchedule[] Schedule { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomInfo.cs index cb596a76e..b9267b2a6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomInfo.cs @@ -21,7 +21,7 @@ public class MeetingRoomInfo [NotNull] [JsonProperty("name")] [JsonPropertyName("name")] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 会议室容纳人数 /// @@ -56,7 +56,7 @@ public class MeetingRoomInfo [NotNull] [JsonProperty("equipment")] [JsonPropertyName("equipment")] - public int[] Equipment { get; set; } + public int[] Equipment { get; set; } = default!; /// /// 会议室坐标 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomSchedule.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomSchedule.cs index 7049e3759..65a3c2a4c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomSchedule.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Models/MeetingRoomSchedule.cs @@ -28,7 +28,7 @@ public class MeetingRoomSchedule [NotNull] [JsonProperty("booker")] [JsonPropertyName("booker")] - public string Booker { get; set; } + public string Booker { get; set; } = default!; /// /// 会议室的预定状态 /// @@ -42,7 +42,7 @@ public class MeetingRoomSchedule [NotNull] [JsonProperty("booking_id")] [JsonPropertyName("booking_id")] - public string BookingId { get; set; } + public string BookingId { get; set; } = default!; /// /// 会议关联日程的id /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomByMeetingResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomByMeetingResponse.cs index 0d72eff3c..ed063df4a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomByMeetingResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomByMeetingResponse.cs @@ -17,12 +17,12 @@ public class WeChatWorkBookMeetingRoomByMeetingResponse : WeChatWorkResponse [NotNull] [JsonProperty("booking_id")] [JsonPropertyName("booking_id")] - public string BookingId { get; set; } + public string BookingId { get; set; } = default!; /// /// 会议室冲突日期列表,为当天0点的时间戳;使用重复日程预定会议室,部分日期与会议室预定情况冲突时返回 /// [NotNull] [JsonProperty("conflict_date")] [JsonPropertyName("conflict_date")] - public long[] ConflictDate { get; set; } + public long[] ConflictDate { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomByScheduleResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomByScheduleResponse.cs index 15a966d4c..cb23bb8df 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomByScheduleResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomByScheduleResponse.cs @@ -17,12 +17,12 @@ public class WeChatWorkBookMeetingRoomByScheduleResponse : WeChatWorkResponse [NotNull] [JsonProperty("booking_id")] [JsonPropertyName("booking_id")] - public string BookingId { get; set; } + public string BookingId { get; set; } = default!; /// /// 会议室冲突日期列表,为当天0点的时间戳;使用重复日程预定会议室,部分日期与会议室预定情况冲突时返回 /// [NotNull] [JsonProperty("conflict_date")] [JsonPropertyName("conflict_date")] - public long[] ConflictDate { get; set; } + public long[] ConflictDate { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomResponse.cs index b913ff72b..0e5a8ee9d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkBookMeetingRoomResponse.cs @@ -17,12 +17,12 @@ public class WeChatWorkBookMeetingRoomResponse : WeChatWorkResponse [NotNull] [JsonProperty("booking_id")] [JsonPropertyName("booking_id")] - public string BookingId { get; set; } + public string BookingId { get; set; } = default!; /// /// 会议关联日程的id /// [NotNull] [JsonProperty("schedule_id")] [JsonPropertyName("schedule_id")] - public string ScheduleId { get; set; } + public string ScheduleId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomBookResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomBookResponse.cs index ae4c9edc8..01f4f7b22 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomBookResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomBookResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetMeetingRoomBookResponse : WeChatWorkResponse [NotNull] [JsonProperty("schedule")] [JsonPropertyName("schedule")] - public MeetingRoomSchedule Schedule { get; set; } + public MeetingRoomSchedule Schedule { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomBookingListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomBookingListResponse.cs index 8c73828cf..497a837ca 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomBookingListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomBookingListResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetMeetingRoomBookingListResponse : WeChatWorkResponse [NotNull] [JsonProperty("booking_list")] [JsonPropertyName("booking_list")] - public MeetingRoomBookingInfo[] BookingList { get; set; } + public MeetingRoomBookingInfo[] BookingList { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomListResponse.cs index 67488e258..bf54fc378 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/MeetingRooms/Response/WeChatWorkGetMeetingRoomListResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetMeetingRoomListResponse : WeChatWorkResponse [NotNull] [JsonProperty("meetingroom_list")] [JsonPropertyName("meetingroom_list")] - public MeetingRoomInfo[] MeetingRoomList { get; set; } + public MeetingRoomInfo[] MeetingRoomList { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/BookMeetingRoomEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/BookMeetingRoomEvent.cs index 3c8e8f54c..5a20932fd 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/BookMeetingRoomEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/BookMeetingRoomEvent.cs @@ -22,7 +22,7 @@ public class BookMeetingRoomEvent : WeChatWorkEventMessage /// 预定id,可根据该ID查询具体的会议预定情况 /// [XmlElement("BookingId")] - public string BookingId { get; set; } + public string BookingId { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/CancelMeetingRoomEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/CancelMeetingRoomEvent.cs index 1ac73aa1e..f6cd3a663 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/CancelMeetingRoomEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/CancelMeetingRoomEvent.cs @@ -22,7 +22,7 @@ public class CancelMeetingRoomEvent : WeChatWorkEventMessage /// 预定id,可根据该ID查询具体的会议预定情况 /// [XmlElement("BookingId")] - public string BookingId { get; set; } + public string BookingId { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/DeleteCalendarEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/DeleteCalendarEvent.cs index 699129f61..c0e2d62b5 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/DeleteCalendarEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/DeleteCalendarEvent.cs @@ -17,7 +17,7 @@ public class DeleteCalendarEvent : WeChatWorkEventMessage /// 日历ID /// [XmlElement("CalId")] - public string CalId { get; set; } + public string CalId { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/DeleteScheduleEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/DeleteScheduleEvent.cs index 7e8347148..8968da542 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/DeleteScheduleEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/DeleteScheduleEvent.cs @@ -22,7 +22,7 @@ public class DeleteScheduleEvent : WeChatWorkEventMessage /// 日程ID /// [XmlElement("ScheduleId")] - public string ScheduleId { get; set; } + public string ScheduleId { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/RespondScheduleEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/RespondScheduleEvent.cs index c32959f5f..43b5eb2e2 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/RespondScheduleEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/RespondScheduleEvent.cs @@ -22,7 +22,7 @@ public class RespondScheduleEvent : WeChatWorkEventMessage /// 日程ID /// [XmlElement("ScheduleId")] - public string ScheduleId { get; set; } + public string ScheduleId { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/UpdateCalendarEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/UpdateCalendarEvent.cs index ca6ecebfd..4edfb5e74 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/UpdateCalendarEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/UpdateCalendarEvent.cs @@ -17,7 +17,7 @@ public class UpdateCalendarEvent : WeChatWorkEventMessage /// 日历ID /// [XmlElement("CalId")] - public string CalId { get; set; } + public string CalId { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/UpdateScheduleEvent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/UpdateScheduleEvent.cs index e698b37a9..ff5ab4aff 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/UpdateScheduleEvent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Messages/Models/UpdateScheduleEvent.cs @@ -22,7 +22,7 @@ public class UpdateScheduleEvent : WeChatWorkEventMessage /// 日程ID /// [XmlElement("ScheduleId")] - public string ScheduleId { get; set; } + public string ScheduleId { get; set; } = default!; public override WeChatMessageEto ToEto() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarFailResult.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarFailResult.cs index bdd7e088f..8e8bf3502 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarFailResult.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarFailResult.cs @@ -14,5 +14,5 @@ public class CalendarFailResult [CanBeNull] [JsonProperty("shares")] [JsonPropertyName("shares")] - public CalendarFailShare[] Shares { get; set; } + public CalendarFailShare[] Shares { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarFailShare.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarFailShare.cs index 35ce724dc..66a2306af 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarFailShare.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarFailShare.cs @@ -21,12 +21,12 @@ public class CalendarFailShare [NotNull] [JsonProperty("errmsg")] [JsonPropertyName("errmsg")] - public string ErrorMessage { get; set; } + public string ErrorMessage { get; set; } = default!; /// /// 日历通知范围成员的id /// [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarInfo.cs index d5a5f2058..3b476226f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarInfo.cs @@ -14,28 +14,28 @@ public class CalendarInfo [NotNull] [JsonProperty("cal_id")] [JsonPropertyName("cal_id")] - public string CalId { get; set; } + public string CalId { get; set; } = default!; /// /// 日历的管理员userid列表 /// [NotNull] [JsonProperty("admins")] [JsonPropertyName("admins")] - public string[] Admins { get; set; } + public string[] Admins { get; set; } = default!; /// /// 日历标题。1 ~ 128 字符 /// [NotNull] [JsonProperty("summary")] [JsonPropertyName("summary")] - public string Summary { get; set; } + public string Summary { get; set; } = default!; /// /// 日历颜色,RGB颜色编码16进制表示,例如:"#0000FF" 表示纯蓝色 /// [NotNull] [JsonProperty("color")] [JsonPropertyName("color")] - public string Color { get; set; } + public string Color { get; set; } = default!; /// /// 日历描述。0 ~ 512 字符 /// @@ -74,5 +74,5 @@ public class CalendarInfo [NotNull] [JsonProperty("shares")] [JsonPropertyName("shares")] - public CalendarShare[] Shares { get; set; } + public CalendarShare[] Shares { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarShare.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarShare.cs index 76a04b8fd..1ea16692f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarShare.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/CalendarShare.cs @@ -14,7 +14,7 @@ public class CalendarShare [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 日历通知范围成员权限 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/ScheduleAttendeeInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/ScheduleAttendeeInfo.cs index 6c2a2c5ff..cbeb74435 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/ScheduleAttendeeInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/ScheduleAttendeeInfo.cs @@ -14,7 +14,7 @@ public class ScheduleAttendeeInfo [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 日程参与者的接受状态 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/ScheduleInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/ScheduleInfo.cs index 6e453bc97..b09001d67 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/ScheduleInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Models/ScheduleInfo.cs @@ -14,28 +14,28 @@ public class ScheduleInfo [NotNull] [JsonProperty("schedule_id")] [JsonPropertyName("schedule_id")] - public string ScheduleId { get; set; } + public string ScheduleId { get; set; } = default!; /// /// 管理员userid列表 /// [NotNull] [JsonProperty("admins")] [JsonPropertyName("admins")] - public string[] Admins { get; set; } + public string[] Admins { get; set; } = default!; /// /// 日程参与者列表 /// [NotNull] [JsonProperty("attendees")] [JsonPropertyName("attendees")] - public ScheduleAttendeeInfo[] Attendees { get; set; } + public ScheduleAttendeeInfo[] Attendees { get; set; } = default!; /// /// 日程标题 /// [NotNull] [JsonProperty("summary")] [JsonPropertyName("summary")] - public string Summary { get; set; } + public string Summary { get; set; } = default!; /// /// 日程描述 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkCreateCalendarResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkCreateCalendarResponse.cs index af72dd826..71f44a827 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkCreateCalendarResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkCreateCalendarResponse.cs @@ -18,12 +18,12 @@ public class WeChatWorkCreateCalendarResponse : WeChatWorkResponse [NotNull] [JsonProperty("cal_id")] [JsonPropertyName("cal_id")] - public string CalId { get; set; } + public string CalId { get; set; } = default!; /// /// 无效的输入内容 /// [NotNull] [JsonProperty("fail_result")] [JsonPropertyName("fail_result")] - public CalendarFailResult FailResult { get; set; } + public CalendarFailResult FailResult { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkCreateScheduleResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkCreateScheduleResponse.cs index 66135f8f6..8ce437321 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkCreateScheduleResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkCreateScheduleResponse.cs @@ -17,5 +17,5 @@ public class WeChatWorkCreateScheduleResponse : WeChatWorkResponse [NotNull] [JsonProperty("schedule_id")] [JsonPropertyName("schedule_id")] - public string ScheduleId { get; set; } + public string ScheduleId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetCalendarListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetCalendarListResponse.cs index 711e1698f..a02f0d8e4 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetCalendarListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetCalendarListResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetCalendarListResponse : WeChatWorkResponse [NotNull] [JsonProperty("calendar_list")] [JsonPropertyName("calendar_list")] - public CalendarInfo[] CalendarList { get; set; } + public CalendarInfo[] CalendarList { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetScheduleListByCalendarResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetScheduleListByCalendarResponse.cs index 7cd960d14..9ab65a222 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetScheduleListByCalendarResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetScheduleListByCalendarResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetScheduleListByCalendarResponse : WeChatWorkResponse [NotNull] [JsonProperty("schedule_list")] [JsonPropertyName("schedule_list")] - public CalendarScheduleInfo[] ScheduleList { get; set; } + public CalendarScheduleInfo[] ScheduleList { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetScheduleListResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetScheduleListResponse.cs index b59e9b977..dcae6f8aa 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetScheduleListResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkGetScheduleListResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkGetScheduleListResponse : WeChatWorkResponse [NotNull] [JsonProperty("schedule_list")] [JsonPropertyName("schedule_list")] - public ScheduleInfo[] ScheduleList { get; set; } + public ScheduleInfo[] ScheduleList { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkUpdateCalendarResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkUpdateCalendarResponse.cs index 95df2183b..845ebf480 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkUpdateCalendarResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkUpdateCalendarResponse.cs @@ -18,5 +18,5 @@ public class WeChatWorkUpdateCalendarResponse : WeChatWorkResponse [NotNull] [JsonProperty("fail_result")] [JsonPropertyName("fail_result")] - public CalendarFailResult FailResult { get; set; } + public CalendarFailResult FailResult { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkUpdateScheduleResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkUpdateScheduleResponse.cs index 11f71ce92..dfa288e04 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkUpdateScheduleResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.OA/LINGYUN/Abp/WeChat/Work/OA/Schedules/Response/WeChatWorkUpdateScheduleResponse.cs @@ -20,5 +20,5 @@ public class WeChatWorkUpdateScheduleResponse : WeChatWorkResponse [NotNull] [JsonProperty("schedule_id")] [JsonPropertyName("schedule_id")] - public string ScheduleId { get; set; } + public string ScheduleId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkException.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkException.cs index 6de70a1c4..fc9151f4c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkException.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkException.cs @@ -10,10 +10,10 @@ public class AbpWeChatWorkException : BusinessException } public AbpWeChatWorkException( - string code = null, - string message = null, - string details = null, - Exception innerException = null) + string? code = null, + string? message = null, + string? details = null, + Exception? innerException = null) : base(code, message, details, innerException) { } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/IWeChatWorkAuthorizeGenerator.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/IWeChatWorkAuthorizeGenerator.cs index 4e999786b..26ec13ea6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/IWeChatWorkAuthorizeGenerator.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/IWeChatWorkAuthorizeGenerator.cs @@ -17,8 +17,8 @@ public interface IWeChatWorkAuthorizeGenerator Task GenerateOAuth2AuthorizeAsync( string redirectUri, string state, - string responseType = "code", - string scope = "snsapi_base"); + string? responseType = "code", + string? scope = "snsapi_base"); /// /// 构建网页登录链接 /// @@ -31,7 +31,7 @@ public interface IWeChatWorkAuthorizeGenerator Task GenerateOAuth2LoginAsync( string redirectUri, string state, - string loginType = "ServiceApp", - string agentId = "", - string lang = "zh"); + string? loginType = "ServiceApp", + string? agentId = "", + string? lang = "zh"); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/IWeChatWorkUserClaimProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/IWeChatWorkUserClaimProvider.cs index 9a6b19960..8a06e73c8 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/IWeChatWorkUserClaimProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/IWeChatWorkUserClaimProvider.cs @@ -15,7 +15,7 @@ public interface IWeChatWorkUserClaimProvider /// /// /// - Task FindUserIdentifierAsync( + Task FindUserIdentifierAsync( Guid userId, CancellationToken cancellationToken = default); /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Models/WeChatWorkUserDetail.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Models/WeChatWorkUserDetail.cs index 09ad39787..4baed7b35 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Models/WeChatWorkUserDetail.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Models/WeChatWorkUserDetail.cs @@ -14,7 +14,7 @@ public class WeChatWorkUserDetail [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 性别。 /// 0表示未定义, @@ -33,7 +33,7 @@ public class WeChatWorkUserDetail [CanBeNull] [JsonProperty("avatar")] [JsonPropertyName("avatar")] - public string Avatar { get; set; } + public string? Avatar { get; set; } /// /// 员工个人二维码(扫描可添加为外部联系人) /// 仅在用户同意snsapi_privateinfo授权时返回 @@ -41,7 +41,7 @@ public class WeChatWorkUserDetail [CanBeNull] [JsonProperty("qr_code")] [JsonPropertyName("qr_code")] - public string QrCode { get; set; } + public string? QrCode { get; set; } /// /// 手机 /// 仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 @@ -49,7 +49,7 @@ public class WeChatWorkUserDetail [CanBeNull] [JsonProperty("mobile")] [JsonPropertyName("mobile")] - public string Mobile { get; set; } + public string? Mobile { get; set; } /// /// 邮箱 /// 仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 @@ -57,7 +57,7 @@ public class WeChatWorkUserDetail [CanBeNull] [JsonProperty("email")] [JsonPropertyName("email")] - public string Email { get; set; } + public string? Email { get; set; } /// /// 企业邮箱 /// 仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 @@ -65,7 +65,7 @@ public class WeChatWorkUserDetail [CanBeNull] [JsonProperty("biz_mail")] [JsonPropertyName("biz_mail")] - public string WorkEmail { get; set; } + public string? WorkEmail { get; set; } /// /// 地址 /// 仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 @@ -73,5 +73,5 @@ public class WeChatWorkUserDetail [CanBeNull] [JsonProperty("address")] [JsonPropertyName("address")] - public string Address { get; set; } + public string? Address { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Models/WeChatWorkUserInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Models/WeChatWorkUserInfo.cs index f86cbac8f..4c3436c82 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Models/WeChatWorkUserInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Models/WeChatWorkUserInfo.cs @@ -14,12 +14,12 @@ public class WeChatWorkUserInfo [NotNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 成员票据,最大为512字节,有效期为1800s /// [NotNull] [JsonProperty("user_ticket")] [JsonPropertyName("user_ticket")] - public string UserTicket { get; set; } + public string UserTicket { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/NullWeChatWorkUserClaimProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/NullWeChatWorkUserClaimProvider.cs index cc4921f84..5861b3584 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/NullWeChatWorkUserClaimProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/NullWeChatWorkUserClaimProvider.cs @@ -11,11 +11,11 @@ namespace LINGYUN.Abp.WeChat.Work.Authorize; public class NullWeChatWorkUserClaimProvider : IWeChatWorkUserClaimProvider { public readonly static IWeChatWorkUserClaimProvider Instance = new NullWeChatWorkUserClaimProvider(); - public Task FindUserIdentifierAsync( + public Task FindUserIdentifierAsync( Guid userId, CancellationToken cancellationToken = default) { - string findUserId = null; + string? findUserId = null; return Task.FromResult(findUserId); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Response/WeChatWorkUserDetailResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Response/WeChatWorkUserDetailResponse.cs index e783e4211..91f09248d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Response/WeChatWorkUserDetailResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Response/WeChatWorkUserDetailResponse.cs @@ -13,7 +13,7 @@ public class WeChatWorkUserDetailResponse : WeChatWorkResponse /// [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 性别。 /// 0表示未定义, @@ -30,40 +30,40 @@ public class WeChatWorkUserDetailResponse : WeChatWorkResponse /// [JsonProperty("avatar")] [JsonPropertyName("avatar")] - public string Avatar { get; set; } + public string? Avatar { get; set; } /// /// 员工个人二维码(扫描可添加为外部联系人) /// 仅在用户同意snsapi_privateinfo授权时返回 /// [JsonProperty("qr_code")] [JsonPropertyName("qr_code")] - public string QrCode { get; set; } + public string? QrCode { get; set; } /// /// 手机 /// 仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 /// [JsonProperty("mobile")] [JsonPropertyName("mobile")] - public string Mobile { get; set; } + public string? Mobile { get; set; } /// /// 邮箱 /// 仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 /// [JsonProperty("email")] [JsonPropertyName("email")] - public string Email { get; set; } + public string? Email { get; set; } /// /// 企业邮箱 /// 仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 /// [JsonProperty("biz_mail")] [JsonPropertyName("biz_mail")] - public string WorkEmail { get; set; } + public string? WorkEmail { get; set; } /// /// 地址 /// 仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 /// [JsonProperty("address")] [JsonPropertyName("address")] - public string Address { get; set; } + public string? Address { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Response/WeChatWorkUserInfoResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Response/WeChatWorkUserInfoResponse.cs index d964b1d3d..5c46deaf3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Response/WeChatWorkUserInfoResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/Response/WeChatWorkUserInfoResponse.cs @@ -12,11 +12,11 @@ public class WeChatWorkUserInfoResponse : WeChatWorkResponse /// [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string UserId { get; set; } = default!; /// /// 成员票据,最大为512字节,有效期为1800s /// [JsonProperty("user_ticket")] [JsonPropertyName("user_ticket")] - public string UserTicket { get; set; } + public string UserTicket { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/WeChatWorkAuthorizeGenerator.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/WeChatWorkAuthorizeGenerator.cs index f9b86e5b9..4d27a483e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/WeChatWorkAuthorizeGenerator.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Authorize/WeChatWorkAuthorizeGenerator.cs @@ -30,8 +30,8 @@ public class WeChatWorkAuthorizeGenerator : IWeChatWorkAuthorizeGenerator, ISing public async virtual Task GenerateOAuth2AuthorizeAsync( string redirectUri, string state, - string responseType = "code", - string scope = "snsapi_base") + string? responseType = "code", + string? scope = "snsapi_base") { var corpId = await SettingProvider.GetOrNullAsync(WeChatWorkSettingNames.Connection.CorpId); var agentId = await SettingProvider.GetOrNullAsync(WeChatWorkSettingNames.Connection.AgentId); @@ -44,7 +44,7 @@ public class WeChatWorkAuthorizeGenerator : IWeChatWorkAuthorizeGenerator, ISing var generatedUrlBuilder = new StringBuilder(); generatedUrlBuilder - .Append(client.BaseAddress.AbsoluteUri.EnsureEndsWith('/')) + .Append(client.BaseAddress!.AbsoluteUri.EnsureEndsWith('/')) .Append("connect/oauth2/authorize") .AppendFormat("?appid={0}", corpId) .AppendFormat("&redirect_uri={0}", HttpUtility.UrlEncode(redirectUri)) @@ -60,9 +60,9 @@ public class WeChatWorkAuthorizeGenerator : IWeChatWorkAuthorizeGenerator, ISing public async virtual Task GenerateOAuth2LoginAsync( string redirectUri, string state, - string loginType = "ServiceApp", - string agentId = "", - string lang = "zh") + string? loginType = "ServiceApp", + string? agentId = "", + string? lang = "zh") { if (agentId.IsNullOrWhiteSpace()) { @@ -78,7 +78,7 @@ public class WeChatWorkAuthorizeGenerator : IWeChatWorkAuthorizeGenerator, ISing var generatedUrlBuilder = new StringBuilder(); generatedUrlBuilder - .Append(client.BaseAddress.AbsoluteUri.EnsureEndsWith('/')) + .Append(client.BaseAddress!.AbsoluteUri.EnsureEndsWith('/')) .Append("wwlogin/sso/login") .AppendFormat("?login_type={0}", loginType) .AppendFormat("&appid={0}", corpId) diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Models/WeChatWorkAppChatInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Models/WeChatWorkAppChatInfo.cs index fa62cc883..f4101aa00 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Models/WeChatWorkAppChatInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Models/WeChatWorkAppChatInfo.cs @@ -10,23 +10,23 @@ public class WeChatWorkAppChatInfo /// [JsonProperty("name")] [JsonPropertyName("name")] - public virtual string Name { get; set; } + public virtual string Name { get; set; } = default!; /// /// 群主id /// [JsonProperty("owner")] [JsonPropertyName("owner")] - public virtual string Owner { get; set; } + public virtual string Owner { get; set; } = default!; /// /// 群成员id列表 /// [JsonProperty("userlist")] [JsonPropertyName("userlist")] - public virtual List Users { get; set; } + public virtual List Users { get; set; } = default!; /// /// 群聊唯一标志 /// [JsonProperty("chatid")] [JsonPropertyName("chatid")] - public virtual string ChatId { get; set; } + public virtual string ChatId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Request/WeChatWorkAppChatCreateRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Request/WeChatWorkAppChatCreateRequest.cs index 728022fca..542bb7571 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Request/WeChatWorkAppChatCreateRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Request/WeChatWorkAppChatCreateRequest.cs @@ -10,8 +10,8 @@ public class WeChatWorkAppChatCreateRequest : WeChatWorkAppChatRequest string agentId, string name, List users, - string owner = null, - string chatId = null) + string? owner = null, + string? chatId = null) : base(agentId) { Name = name; @@ -34,7 +34,7 @@ public class WeChatWorkAppChatCreateRequest : WeChatWorkAppChatRequest [CanBeNull] [JsonProperty("owner")] [JsonPropertyName("owner")] - public virtual string Owner { get; set; } + public virtual string? Owner { get; set; } /// /// 群成员id列表。 /// 至少2人,至多2000人 @@ -52,5 +52,5 @@ public class WeChatWorkAppChatCreateRequest : WeChatWorkAppChatRequest [CanBeNull] [JsonProperty("chatid")] [JsonPropertyName("chatid")] - public virtual string ChatId { get; set; } + public virtual string? ChatId { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Request/WeChatWorkAppChatUpdateRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Request/WeChatWorkAppChatUpdateRequest.cs index 3a435e1de..4c42f8dd9 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Request/WeChatWorkAppChatUpdateRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Request/WeChatWorkAppChatUpdateRequest.cs @@ -9,10 +9,10 @@ public class WeChatWorkAppChatUpdateRequest : WeChatWorkAppChatRequest public WeChatWorkAppChatUpdateRequest( string agentId, string chatId, - string name = null, - string owner = null, - List addUsers = null, - List delUsers = null) + string? name = null, + string? owner = null, + List? addUsers = null, + List? delUsers = null) : base(agentId) { Name = name; @@ -28,7 +28,7 @@ public class WeChatWorkAppChatUpdateRequest : WeChatWorkAppChatRequest [CanBeNull] [JsonProperty("name")] [JsonPropertyName("name")] - public virtual string Name { get; set; } + public virtual string? Name { get; set; } /// /// 新群主的id。 /// 若不需更新,请忽略此参数。课程群聊群主必须在设置的群主列表内 @@ -36,21 +36,21 @@ public class WeChatWorkAppChatUpdateRequest : WeChatWorkAppChatRequest [CanBeNull] [JsonProperty("owner")] [JsonPropertyName("owner")] - public virtual string Owner { get; set; } + public virtual string? Owner { get; set; } /// /// 添加成员的id列表 /// [CanBeNull] [JsonProperty("add_user_list")] [JsonPropertyName("add_user_list")] - public virtual List AddUsers { get; set; } + public virtual List? AddUsers { get; set; } /// /// 踢出成员的id列表 /// [CanBeNull] [JsonProperty("del_user_list")] [JsonPropertyName("del_user_list")] - public virtual List DelUsers { get; set; } + public virtual List? DelUsers { get; set; } /// /// 群聊id /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Response/WeChatWorkAppChatCreateResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Response/WeChatWorkAppChatCreateResponse.cs index 6cb9cfafc..996a6ac83 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Response/WeChatWorkAppChatCreateResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Response/WeChatWorkAppChatCreateResponse.cs @@ -10,5 +10,5 @@ public class WeChatWorkAppChatCreateResponse : WeChatWorkResponse /// [JsonProperty("chatid")] [JsonPropertyName("chatid")] - public virtual string ChatId { get; set; } + public virtual string ChatId { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Response/WeChatWorkAppChatInfoResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Response/WeChatWorkAppChatInfoResponse.cs index 55db5fec2..bcad294e6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Response/WeChatWorkAppChatInfoResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Chat/Response/WeChatWorkAppChatInfoResponse.cs @@ -10,5 +10,5 @@ public class WeChatWorkAppChatInfoResponse : WeChatWorkResponse /// [JsonProperty("chat_info")] [JsonPropertyName("chat_info")] - public WeChatWorkAppChatInfo ChatInfo { get; set; } + public WeChatWorkAppChatInfo ChatInfo { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/JsSdk/Models/JsApiTicketInfo.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/JsSdk/Models/JsApiTicketInfo.cs index 3b432736a..c5e7b266d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/JsSdk/Models/JsApiTicketInfo.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/JsSdk/Models/JsApiTicketInfo.cs @@ -4,7 +4,7 @@ public class JsApiTicketInfo /// /// 生成签名所需的 jsapi_ticket,最长为512字节 /// - public string Ticket { get; set; } + public string Ticket { get; set; } = default!; /// /// 凭证的有效时间(秒) /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/JsSdk/Models/JsApiTicketInfoCacheItem.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/JsSdk/Models/JsApiTicketInfoCacheItem.cs index eb48d8133..908b57c60 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/JsSdk/Models/JsApiTicketInfoCacheItem.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/JsSdk/Models/JsApiTicketInfoCacheItem.cs @@ -2,7 +2,7 @@ public class JsApiTicketInfoCacheItem { - public string Ticket { get; set; } + public string Ticket { get; set; } = default!; public int ExpiresIn { get; set; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/Models/WeChatWorkImageResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/Models/WeChatWorkImageResponse.cs index 85d9f12ec..479468683 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/Models/WeChatWorkImageResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/Models/WeChatWorkImageResponse.cs @@ -7,5 +7,5 @@ public class WeChatWorkImageResponse : WeChatWorkResponse /// 上传后得到的图片URL。永久有效 /// [JsonProperty("url")] - public string Url { get; set; } + public string Url { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/Models/WeChatWorkMediaResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/Models/WeChatWorkMediaResponse.cs index 9f7e29460..1ed16c754 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/Models/WeChatWorkMediaResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/Models/WeChatWorkMediaResponse.cs @@ -13,15 +13,15 @@ public class WeChatWorkMediaResponse : WeChatWorkResponse /// 普通文件(file) /// [JsonProperty("type")] - public string Type { get; set; } + public string Type { get; set; } = default!; /// /// 媒体文件上传后获取的唯一标识,3天内有效 /// [JsonProperty("media_id")] - public string MediaId { get; set; } + public string MediaId { get; set; } = default!; /// /// 媒体文件上传时间戳 /// [JsonProperty("created_at")] - public string CreatedAt { get; set; } + public string CreatedAt { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/WeChatWorkMediaProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/WeChatWorkMediaProvider.cs index 0c88543ae..21e05488f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/WeChatWorkMediaProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Media/WeChatWorkMediaProvider.cs @@ -41,8 +41,8 @@ public class WeChatWorkMediaProvider : IWeChatWorkMediaProvider, ISingletonDepen } var mediaStream = await response.Content.ReadAsStreamAsync(); - string fileName = null; - string contentType = null; + string? fileName = null; + string? contentType = null; if (response.Headers.TryGetValues("Content-Disposition", out var contentDispositions)) { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/MiniProgramMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/MiniProgramMessage.cs index d2c5622f5..15d509872 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/MiniProgramMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/MiniProgramMessage.cs @@ -15,28 +15,28 @@ public class MiniProgramMessage [NotNull] [JsonProperty("appid")] [JsonPropertyName("appid")] - public string AppId { get; set; } + public string AppId { get; set; } = default!; /// /// 消息标题,长度限制4-12个汉字(支持id转译) /// [NotNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string Title { get; set; } = default!; /// /// 点击消息卡片后的小程序页面,最长1024个字节,仅限本小程序内的页面。该字段不填则消息点击后不跳转。 /// [CanBeNull] [JsonProperty("page")] [JsonPropertyName("page")] - public string Page { get; set; } + public string? Page { get; set; } /// /// 消息描述,长度限制4-12个汉字(支持id转译) /// [CanBeNull] [JsonProperty("description")] [JsonPropertyName("description")] - public string Description { get; set; } + public string? Description { get; set; } /// /// 是否放大第一个content_item /// @@ -50,17 +50,16 @@ public class MiniProgramMessage [CanBeNull] [JsonProperty("content_item")] [JsonPropertyName("content_item")] - public List ContentItems{ get; set; } + public List? ContentItems { get; set; } public MiniProgramMessage() { - ContentItems = new List(); } public MiniProgramMessage( string appId, string title, - string page = null, - string description = null, + string? page = null, + string? description = null, bool? emphasisFirstItem = null) { AppId = appId; @@ -79,12 +78,12 @@ public class MiniProgramContent [NotNull] [JsonProperty("key")] [JsonPropertyName("key")] - public string Key { get; set; } + public string Key { get; set; } = default!; /// /// 长度30个汉字以内(支持id转译) /// [NotNull] [JsonProperty("value")] [JsonPropertyName("value")] - public string Value { get; set; } + public string Value { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardCardAction.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardCardAction.cs index 3710ea510..91a6b360e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardCardAction.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardCardAction.cs @@ -32,19 +32,19 @@ public class TemplateCardCardAction [CanBeNull] [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string? Url { get; set; } /// /// 跳转链接的小程序的appid,必须是与当前应用关联的小程序,card_action.type是2时必填 /// [CanBeNull] [JsonProperty("appid")] [JsonPropertyName("appid")] - public string AppId { get; set; } + public string? AppId { get; set; } /// /// 跳转链接的小程序的pagepath,card_action.type是2时选填 /// [CanBeNull] [JsonProperty("pagepath")] [JsonPropertyName("pagepath")] - public string PagePath { get; set; } + public string? PagePath { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardJump.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardJump.cs index f996ec1a7..9a2819869 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardJump.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardJump.cs @@ -44,19 +44,19 @@ public class TemplateCardJump [CanBeNull] [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string? Url { get; set; } /// /// 跳转链接的小程序的appid,必须是与当前应用关联的小程序,jump_list.type是2时必填 /// [CanBeNull] [JsonProperty("appid")] [JsonPropertyName("appid")] - public string AppId { get; set; } + public string? AppId { get; set; } /// /// 跳转链接的小程序的pagepath,jump_list.type是2时选填 /// [CanBeNull] [JsonProperty("pagepath")] [JsonPropertyName("pagepath")] - public string PagePath { get; set; } + public string? PagePath { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardQuoteArea.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardQuoteArea.cs index 0626cc7a9..58d23c49e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardQuoteArea.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TemplateCardQuoteArea.cs @@ -36,21 +36,21 @@ public class TemplateCardQuoteArea [CanBeNull] [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string? Url { get; set; } /// /// 点击跳转的小程序的appid,必须是与当前应用关联的小程序,quote_area.type是2时必填 /// [CanBeNull] [JsonProperty("appid")] [JsonPropertyName("appid")] - public string AppId { get; set; } + public string? AppId { get; set; } /// /// 点击跳转的小程序的pagepath,quote_area.type是2时选填 /// [CanBeNull] [JsonProperty("pagepath")] [JsonPropertyName("pagepath")] - public string PagePath { get; set; } + public string? PagePath { get; set; } /// /// 引用文献样式的标题 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TextTemplateCard.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TextTemplateCard.cs index 7e9955712..c73eed500 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TextTemplateCard.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/TextTemplateCard.cs @@ -21,56 +21,56 @@ public class TextTemplateCard : TemplateCard [CanBeNull] [JsonProperty("source")] [JsonPropertyName("source")] - public TemplateCardSource Source { get; set; } + public TemplateCardSource? Source { get; set; } /// /// 卡片右上角更多操作按钮 /// [CanBeNull] [JsonProperty("action_menu")] [JsonPropertyName("action_menu")] - public TemplateCardActionMenu ActionMenu { get; set; } + public TemplateCardActionMenu? ActionMenu { get; set; } /// /// 一级标题 /// [CanBeNull] [JsonProperty("main_title")] [JsonPropertyName("main_title")] - public TemplateCardMainTitle MainTitle { get; set; } + public TemplateCardMainTitle? MainTitle { get; set; } /// /// 二级普通文本,建议不超过160个字,(支持id转译) /// [CanBeNull] [JsonProperty("sub_title_text")] [JsonPropertyName("sub_title_text")] - public string SubTitle { get; set; } + public string? SubTitle { get; set; } /// /// 引用文献样式 /// [CanBeNull] [JsonProperty("quote_area")] [JsonPropertyName("quote_area")] - public TemplateCardQuoteArea QuoteArea { get; set; } + public TemplateCardQuoteArea? QuoteArea { get; set; } /// /// 关键数据样式 /// [CanBeNull] [JsonProperty("emphasis_content")] [JsonPropertyName("emphasis_content")] - public TemplateCardEmphasisContent EmphasisContent { get; set; } + public TemplateCardEmphasisContent? EmphasisContent { get; set; } /// /// 二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6 /// [CanBeNull] [JsonProperty("horizontal_content_list")] [JsonPropertyName("horizontal_content_list")] - public List HorizontalContents { get; set; } + public List? HorizontalContents { get; set; } /// /// 跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3 /// [CanBeNull] [JsonProperty("jump_list")] [JsonPropertyName("jump_list")] - public List Jumps { get; set; } + public List? Jumps { get; set; } /// /// 整体卡片的点击跳转事件,text_notice必填本字段 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/VideoMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/VideoMessage.cs index 1150e052d..3b0aed5db 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/VideoMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/VideoMessage.cs @@ -24,14 +24,14 @@ public class VideoMessage [CanBeNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string? Title { get; set; } /// /// 视频消息的描述,不超过512个字节,超过会自动截断 /// [CanBeNull] [JsonProperty("description")] [JsonPropertyName("description")] - public string Description { get; set; } + public string? Description { get; set; } /// /// 视频媒体文件id,可以调用上传临时素材接口获取 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WeChatWorkMiniProgramMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WeChatWorkMiniProgramMessage.cs index 7994e897b..e23d0fb38 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WeChatWorkMiniProgramMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WeChatWorkMiniProgramMessage.cs @@ -14,21 +14,21 @@ public class WeChatWorkMiniProgramMessage /// [JsonProperty("touser")] [JsonPropertyName("touser")] - public virtual string ToUser { get; set; } + public virtual string? ToUser { get; set; } /// /// 指定接收消息的部门,部门ID列表,多个接收者用‘|’分隔,最多支持100个。 /// 当touser为"@all"时忽略本参数 /// [JsonProperty("toparty")] [JsonPropertyName("toparty")] - public virtual string ToParty { get; set; } + public virtual string? ToParty { get; set; } /// /// 指定接收消息的标签,标签ID列表,多个接收者用‘|’分隔,最多支持100个。 /// 当touser为"@all"时忽略本参数 /// [JsonProperty("totag")] [JsonPropertyName("totag")] - public virtual string ToTag { get; set; } + public virtual string? ToTag { get; set; } /// /// 消息类型 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookNewsMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookNewsMessage.cs index 920e04067..a115414d0 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookNewsMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookNewsMessage.cs @@ -52,7 +52,7 @@ public class WebhookArticleMessage [StringLength(512)] [JsonProperty("description")] [JsonPropertyName("description")] - public string Description { get; set; } + public string? Description { get; set; } /// /// 点击后跳转的链接。 /// @@ -66,7 +66,7 @@ public class WebhookArticleMessage [CanBeNull] [JsonProperty("picurl")] [JsonPropertyName("picurl")] - public string PictureUrl { get; set; } + public string? PictureUrl { get; set; } /// /// 创建一个图文消息 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookNewsNoticeCardMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookNewsNoticeCardMessage.cs index f45675cac..eb727f4ed 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookNewsNoticeCardMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookNewsNoticeCardMessage.cs @@ -24,14 +24,14 @@ public class WebhookNewsNoticeCardMessage : WebhookTemplateCardMessage [CanBeNull] [JsonProperty("image_text_area")] [JsonPropertyName("image_text_area")] - public WebhookTemplateCardImageTextArea ImageTextArea { get; set; } + public WebhookTemplateCardImageTextArea? ImageTextArea { get; set; } /// /// 卡片二级垂直内容,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过4 /// [CanBeNull] [JsonProperty("vertical_content_list")] [JsonPropertyName("vertical_content_list")] - public List VerticalContents { get; set; } + public List? VerticalContents { get; set; } /// /// 创建一个Webhook 图文展示模版卡片消息体 /// @@ -49,12 +49,12 @@ public class WebhookNewsNoticeCardMessage : WebhookTemplateCardMessage WebhookTemplateCardImage cardImage, WebhookTemplateCardAction action, WebhookTemplateCardMainTitle mainTitle, - WebhookTemplateCardImageTextArea imageTextArea = null, - WebhookTemplateCardSource source = null, - WebhookTemplateCardQuoteArea quoteArea = null, - List horizontalContents = null, - List verticalContents = null, - List jumps = null) + WebhookTemplateCardImageTextArea? imageTextArea = null, + WebhookTemplateCardSource? source = null, + WebhookTemplateCardQuoteArea? quoteArea = null, + List? horizontalContents = null, + List? verticalContents = null, + List? jumps = null) : base("news_notice", action, mainTitle, source, quoteArea, horizontalContents, jumps) { Check.NotNull(mainTitle, nameof(mainTitle)); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardAction.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardAction.cs index a02ada44c..d4fea6930 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardAction.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardAction.cs @@ -22,26 +22,26 @@ public class WebhookTemplateCardAction [CanBeNull] [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string? Url { get; set; } /// /// 点击跳转的小程序的appid,type是2时必填 /// [CanBeNull] [JsonProperty("appid")] [JsonPropertyName("appid")] - public string AppId { get; set; } + public string? AppId { get; set; } /// /// 点击跳转的小程序的pagepath,type是2时选填 /// [CanBeNull] [JsonProperty("pagepath")] [JsonPropertyName("pagepath")] - public string PagePath { get; set; } + public string? PagePath { get; set; } private WebhookTemplateCardAction( int type, - string url = null, - string appId = null, - string pagePath = null) + string? url = null, + string? appId = null, + string? pagePath = null) { Type = type; Url = url; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardEmphasisContent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardEmphasisContent.cs index 91394867a..6daa1b999 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardEmphasisContent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardEmphasisContent.cs @@ -14,20 +14,20 @@ public class WebhookTemplateCardEmphasisContent [CanBeNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string? Title { get; set; } /// /// 关键数据样式的数据描述内容,建议不超过15个字 /// [CanBeNull] [JsonProperty("desc")] [JsonPropertyName("desc")] - public string Description { get; set; } + public string? Description { get; set; } /// /// 创建一个关键数据样式 /// /// 关键数据样式的数据内容 /// 关键数据样式的数据描述内容 - public WebhookTemplateCardEmphasisContent(string title, string description = null) + public WebhookTemplateCardEmphasisContent(string title, string? description = null) { Title = title; Description = description; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardHorizontalContent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardHorizontalContent.cs index 96e2c3341..a1dd4d056 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardHorizontalContent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardHorizontalContent.cs @@ -29,35 +29,35 @@ public class WebhookTemplateCardHorizontalContent [CanBeNull] [JsonProperty("value")] [JsonPropertyName("value")] - public string Value { get; set; } + public string? Value { get; set; } /// /// 链接跳转的url,type是1时必填 /// [CanBeNull] [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string? Url { get; set; } /// /// 附件的media_id,type是2时必填 /// [CanBeNull] [JsonProperty("media_id")] [JsonPropertyName("media_id")] - public string MediaId { get; set; } + public string? MediaId { get; set; } /// /// 成员详情的userid,type是3时必填 /// [CanBeNull] [JsonProperty("userid")] [JsonPropertyName("userid")] - public string UserId { get; set; } + public string? UserId { get; set; } private WebhookTemplateCardHorizontalContent( string keyName, int? type = null, - string value = null, - string url = null, - string mediaId = null, - string userId = null) + string? value = null, + string? url = null, + string? mediaId = null, + string? userId = null) { Type = type; KeyName = keyName; @@ -72,7 +72,7 @@ public class WebhookTemplateCardHorizontalContent /// 二级标题 /// 二级文本 /// - public static WebhookTemplateCardHorizontalContent Default(string keyName, string value = null) + public static WebhookTemplateCardHorizontalContent Default(string keyName, string? value = null) { Check.NotNullOrWhiteSpace(keyName, nameof(keyName)); @@ -85,7 +85,7 @@ public class WebhookTemplateCardHorizontalContent /// 链接跳转的url /// 二级文本 /// - public static WebhookTemplateCardHorizontalContent Link(string keyName, string url, string value = null) + public static WebhookTemplateCardHorizontalContent Link(string keyName, string url, string? value = null) { Check.NotNullOrWhiteSpace(keyName, nameof(keyName)); Check.NotNullOrWhiteSpace(url, nameof(url)); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardImageTextArea.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardImageTextArea.cs index ef5ff32fb..a75fa0d59 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardImageTextArea.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardImageTextArea.cs @@ -29,43 +29,43 @@ public class WebhookTemplateCardImageTextArea [NotNull] [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string? Url { get; set; } /// /// 点击跳转的小程序的appid,type是2时必填 /// [CanBeNull] [JsonProperty("appid")] [JsonPropertyName("appid")] - public string AppId { get; set; } + public string? AppId { get; set; } /// /// 点击跳转的小程序的pagepath,type是2时选填 /// [CanBeNull] [JsonProperty("pagepath")] [JsonPropertyName("pagepath")] - public string PagePath { get; set; } + public string? PagePath { get; set; } /// /// 左图右文样式的标题 /// [CanBeNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string? Title { get; set; } /// /// 左图右文样式的描述 /// [CanBeNull] [JsonProperty("desc")] [JsonPropertyName("desc")] - public string Description { get; set; } + public string? Description { get; set; } private WebhookTemplateCardImageTextArea( string imageUrl, int? type = null, - string url = null, - string appId = null, - string pagePath = null, - string title = null, - string description = null) + string? url = null, + string? appId = null, + string? pagePath = null, + string? title = null, + string? description = null) { Type = type; ImageUrl = imageUrl; @@ -86,8 +86,8 @@ public class WebhookTemplateCardImageTextArea public static WebhookTemplateCardImageTextArea Link( string imageUrl, string url, - string title = null, - string description = null) + string? title = null, + string? description = null) { Check.NotNullOrWhiteSpace(imageUrl, nameof(imageUrl)); Check.NotNullOrWhiteSpace(url, nameof(url)); @@ -107,8 +107,8 @@ public class WebhookTemplateCardImageTextArea string imageUrl, string appId, string pagePath, - string title = null, - string description = null) + string? title = null, + string? description = null) { Check.NotNullOrWhiteSpace(imageUrl, nameof(imageUrl)); Check.NotNullOrWhiteSpace(appId, nameof(appId)); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardJump.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardJump.cs index 45a33fbc6..72445dadd 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardJump.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardJump.cs @@ -29,27 +29,27 @@ public class WebhookTemplateCardJump [CanBeNull] [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string? Url { get; set; } /// /// 点击跳转的小程序的appid,type是2时必填 /// [CanBeNull] [JsonProperty("appid")] [JsonPropertyName("appid")] - public string AppId { get; set; } + public string? AppId { get; set; } /// /// 点击跳转的小程序的pagepath,type是2时选填 /// [CanBeNull] [JsonProperty("pagepath")] [JsonPropertyName("pagepath")] - public string PagePath { get; set; } + public string? PagePath { get; set; } private WebhookTemplateCardJump( string title, int? type = null, - string url = null, - string appId = null, - string pagePath = null) + string? url = null, + string? appId = null, + string? pagePath = null) { Type = type; Title = title; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardMainTitle.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardMainTitle.cs index 9a4db37b1..fd19d5d65 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardMainTitle.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardMainTitle.cs @@ -14,20 +14,20 @@ public class WebhookTemplateCardMainTitle [CanBeNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string? Title { get; set; } /// /// 标题辅助信息,建议不超过30个字 /// [CanBeNull] [JsonProperty("desc")] [JsonPropertyName("desc")] - public string Description { get; set; } + public string? Description { get; set; } /// /// 创建一个模版卡片的主要内容 /// /// 一级标题 /// 标题辅助信息 - public WebhookTemplateCardMainTitle(string title, string description = null) + public WebhookTemplateCardMainTitle(string title, string? description = null) { Title = title; Description = description; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardMessage.cs index 83c279e37..9bffb8974 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardMessage.cs @@ -17,49 +17,49 @@ public abstract class WebhookTemplateCardMessage [CanBeNull] [JsonProperty("card_type")] [JsonPropertyName("card_type")] - public string CardType { get; set; } + public string? CardType { get; set; } /// /// 卡片来源样式信息,不需要来源样式可不填写 /// [CanBeNull] [JsonProperty("source")] [JsonPropertyName("source")] - public WebhookTemplateCardSource Source { get; set; } + public WebhookTemplateCardSource? Source { get; set; } /// /// 模版卡片的主要内容,包括一级标题和标题辅助信息 /// [CanBeNull] [JsonProperty("main_title")] [JsonPropertyName("main_title")] - public WebhookTemplateCardMainTitle MainTitle { get; set; } + public WebhookTemplateCardMainTitle? MainTitle { get; set; } /// /// 引用文献样式,建议不与关键数据共用 /// [CanBeNull] [JsonProperty("quote_area")] [JsonPropertyName("quote_area")] - public WebhookTemplateCardQuoteArea QuoteArea { get; set; } + public WebhookTemplateCardQuoteArea? QuoteArea { get; set; } /// /// 二级标题+文本列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过6 /// [CanBeNull] [JsonProperty("horizontal_content_list")] [JsonPropertyName("horizontal_content_list")] - public List HorizontalContents { get; set; } + public List? HorizontalContents { get; set; } /// /// 跳转指引样式的列表,该字段可为空数组,但有数据的话需确认对应字段是否必填,列表长度不超过3 /// [CanBeNull] [JsonProperty("jump_list")] [JsonPropertyName("jump_list")] - public List Jumps { get; set; } + public List? Jumps { get; set; } /// /// 整体卡片的点击跳转事件,text_notice模版卡片中该字段为必填项 /// [CanBeNull] [JsonProperty("card_action")] [JsonPropertyName("card_action")] - public WebhookTemplateCardAction Action { get; set; } + public WebhookTemplateCardAction? Action { get; set; } /// /// 创建一个Webhook模板卡片消息体 /// @@ -74,11 +74,11 @@ public abstract class WebhookTemplateCardMessage protected WebhookTemplateCardMessage( string cardType, WebhookTemplateCardAction action, - WebhookTemplateCardMainTitle mainTitle = null, - WebhookTemplateCardSource source = null, - WebhookTemplateCardQuoteArea quoteArea = null, - List horizontalContents = null, - List jumps = null) + WebhookTemplateCardMainTitle? mainTitle = null, + WebhookTemplateCardSource? source = null, + WebhookTemplateCardQuoteArea? quoteArea = null, + List? horizontalContents = null, + List? jumps = null) { CardType = Check.NotNullOrWhiteSpace(cardType, nameof(cardType)); Action = Check.NotNull(action, nameof(action)); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardQuoteArea.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardQuoteArea.cs index dd00cd366..d423088a9 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardQuoteArea.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardQuoteArea.cs @@ -22,42 +22,42 @@ public class WebhookTemplateCardQuoteArea [CanBeNull] [JsonProperty("url")] [JsonPropertyName("url")] - public string Url { get; set; } + public string? Url { get; set; } /// /// 点击跳转的小程序的appid,type是2时必填 /// [CanBeNull] [JsonProperty("appid")] [JsonPropertyName("appid")] - public string AppId { get; set; } + public string? AppId { get; set; } /// /// 点击跳转的小程序的pagepath,type是2时选填 /// [CanBeNull] [JsonProperty("pagepath")] [JsonPropertyName("pagepath")] - public string PagePath { get; set; } + public string? PagePath { get; set; } /// /// 引用文献样式的标题 /// [CanBeNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string? Title { get; set; } /// /// 引用文献样式的引用文案 /// [CanBeNull] [JsonProperty("quote_text")] [JsonPropertyName("quote_text")] - public string QuoteText { get; set; } + public string? QuoteText { get; set; } private WebhookTemplateCardQuoteArea( string title, int? type = null, - string url = null, - string appId = null, - string pagePath = null, - string quoteText = null) + string? url = null, + string? appId = null, + string? pagePath = null, + string? quoteText = null) { Title = title; QuoteText = quoteText; @@ -72,7 +72,7 @@ public class WebhookTemplateCardQuoteArea /// 引用文献样式的标题 /// 引用文献样式的引用文案 /// - public static WebhookTemplateCardQuoteArea Default(string title, string quoteText = null) + public static WebhookTemplateCardQuoteArea Default(string title, string? quoteText = null) { Check.NotNullOrWhiteSpace(title, nameof(title)); @@ -85,7 +85,7 @@ public class WebhookTemplateCardQuoteArea /// 点击跳转的url /// 引用文献样式的引用文案 /// - public static WebhookTemplateCardQuoteArea Link(string title, string url, string quoteText = null) + public static WebhookTemplateCardQuoteArea Link(string title, string url, string? quoteText = null) { Check.NotNullOrWhiteSpace(title, nameof(title)); Check.NotNullOrWhiteSpace(url, nameof(url)); @@ -100,7 +100,7 @@ public class WebhookTemplateCardQuoteArea /// 跳转链接的小程序的pagepath /// 引用文献样式的引用文案 /// - public static WebhookTemplateCardQuoteArea MiniProgram(string title, string appId, string pagePath, string quoteText = null) + public static WebhookTemplateCardQuoteArea MiniProgram(string title, string appId, string pagePath, string? quoteText = null) { Check.NotNullOrWhiteSpace(title, nameof(title)); Check.NotNullOrWhiteSpace(appId, nameof(appId)); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardSource.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardSource.cs index 322dec87b..b424df8f1 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardSource.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardSource.cs @@ -14,14 +14,14 @@ public class WebhookTemplateCardSource [CanBeNull] [JsonProperty("icon_url")] [JsonPropertyName("icon_url")] - public string IconUrl { get; set; } + public string? IconUrl { get; set; } /// /// 来源图片的描述,建议不超过13个字 /// [CanBeNull] [JsonProperty("desc")] [JsonPropertyName("desc")] - public string Description { get; set; } + public string? Description { get; set; } /// /// 来源文字的颜色,目前支持:0(默认) 灰色,1 黑色,2 红色,3 绿色 /// @@ -30,8 +30,8 @@ public class WebhookTemplateCardSource [JsonPropertyName("desc_color")] public int? DescriptionColor { get; set; } private WebhookTemplateCardSource( - string iconUrl = null, - string description = null, + string? iconUrl = null, + string? description = null, int? descriptionColor = 0) { IconUrl = iconUrl; @@ -44,7 +44,7 @@ public class WebhookTemplateCardSource /// 来源图片的url /// 来源图片的描述 /// - public static WebhookTemplateCardSource Grey(string iconUrl, string description = null) + public static WebhookTemplateCardSource Grey(string iconUrl, string? description = null) { return new WebhookTemplateCardSource(iconUrl, description, 0); } @@ -54,7 +54,7 @@ public class WebhookTemplateCardSource /// 来源图片的url /// 来源图片的描述 /// - public static WebhookTemplateCardSource Black(string iconUrl, string description = null) + public static WebhookTemplateCardSource Black(string iconUrl, string? description = null) { return new WebhookTemplateCardSource(iconUrl, description, 1); } @@ -64,7 +64,7 @@ public class WebhookTemplateCardSource /// 来源图片的url /// 来源图片的描述 /// - public static WebhookTemplateCardSource Red(string iconUrl, string description = null) + public static WebhookTemplateCardSource Red(string iconUrl, string? description = null) { return new WebhookTemplateCardSource(iconUrl, description, 2); } @@ -74,7 +74,7 @@ public class WebhookTemplateCardSource /// 来源图片的url /// 来源图片的描述 /// - public static WebhookTemplateCardSource Green(string iconUrl, string description = null) + public static WebhookTemplateCardSource Green(string iconUrl, string? description = null) { return new WebhookTemplateCardSource(iconUrl, description, 3); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardVerticalContent.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardVerticalContent.cs index 3301e0a33..a0abfd0da 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardVerticalContent.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTemplateCardVerticalContent.cs @@ -14,20 +14,20 @@ public class WebhookTemplateCardVerticalContent [CanBeNull] [JsonProperty("title")] [JsonPropertyName("title")] - public string Title { get; set; } + public string? Title { get; set; } /// /// 二级普通文本,建议不超过112个字 /// [CanBeNull] [JsonProperty("desc")] [JsonPropertyName("desc")] - public string Description { get; set; } + public string? Description { get; set; } /// /// 创建一个卡片二级垂直内容 /// /// 卡片二级标题 /// 二级普通文本 - public WebhookTemplateCardVerticalContent(string title, string description = null) + public WebhookTemplateCardVerticalContent(string title, string? description = null) { Title = title; Description = description; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTextMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTextMessage.cs index cba2ec275..f67df1549 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTextMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTextMessage.cs @@ -41,5 +41,8 @@ public class WebhookTextMessage public WebhookTextMessage(string content) { Content = Check.NotNullOrWhiteSpace(content, nameof(content), 2048); + + MentionedList = new List(); + MentionedMobileList = new List(); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTextNoticeCardMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTextNoticeCardMessage.cs index 24e208f0b..b1ddba697 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTextNoticeCardMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Models/WebhookTextNoticeCardMessage.cs @@ -16,14 +16,14 @@ public class WebhookTextNoticeCardMessage : WebhookTemplateCardMessage [CanBeNull] [JsonProperty("sub_title_text")] [JsonPropertyName("sub_title_text")] - public string SubTitleText { get; set; } + public string? SubTitleText { get; set; } /// /// 关键数据样式 /// [CanBeNull] [JsonProperty("emphasis_content")] [JsonPropertyName("emphasis_content")] - public WebhookTemplateCardEmphasisContent EmphasisContent { get; set; } + public WebhookTemplateCardEmphasisContent? EmphasisContent { get; set; } /// /// 创建一个Webhook 文本通知模版卡片消息体 /// @@ -38,13 +38,13 @@ public class WebhookTextNoticeCardMessage : WebhookTemplateCardMessage /// public WebhookTextNoticeCardMessage( WebhookTemplateCardAction action, - WebhookTemplateCardMainTitle mainTitle = null, - string subTitleText = null, - WebhookTemplateCardEmphasisContent emphasisContent = null, - WebhookTemplateCardSource source = null, - WebhookTemplateCardQuoteArea quoteArea = null, - List horizontalContents = null, - List jumps = null) + WebhookTemplateCardMainTitle? mainTitle = null, + string? subTitleText = null, + WebhookTemplateCardEmphasisContent? emphasisContent = null, + WebhookTemplateCardSource? source = null, + WebhookTemplateCardQuoteArea? quoteArea = null, + List? horizontalContents = null, + List? jumps = null) : base("text_notice", action, mainTitle, source, quoteArea, horizontalContents, jumps) { MainTitle = mainTitle; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Response/WeChatWorkMessageResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Response/WeChatWorkMessageResponse.cs index 999bf311e..87578f810 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Response/WeChatWorkMessageResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/Response/WeChatWorkMessageResponse.cs @@ -12,36 +12,36 @@ public class WeChatWorkMessageResponse : WeChatWorkResponse /// [JsonProperty("invaliduser")] [JsonPropertyName("invaliduser")] - public string InvalidUser { get; set; } + public string? InvalidUser { get; set; } /// /// 不合法的partyid /// [JsonProperty("invalidparty")] [JsonPropertyName("invalidparty")] - public string InvalidParty { get; set; } + public string? InvalidParty { get; set; } /// /// 不合法的标签id /// [JsonProperty("invalidtag")] [JsonPropertyName("invalidtag")] - public string InvalidTag { get; set; } + public string? InvalidTag { get; set; } /// /// 没有基础接口许可(包含已过期)的userid /// [JsonProperty("unlicenseduser")] [JsonPropertyName("unlicenseduser")] - public string UnLicensedUser { get; set; } + public string? UnLicensedUser { get; set; } /// /// 消息id,用于撤回应用消息 /// [JsonProperty("msgid")] [JsonPropertyName("msgid")] - public string MsgId { get; set; } + public string? MsgId { get; set; } /// /// 仅消息类型为“按钮交互型”,“投票选择型”和“多项选择型”的模板卡片消息返回, /// 应用可使用response_code调用更新模版卡片消息接口,72小时内有效,且只能使用一次 /// [JsonProperty("response_code")] [JsonPropertyName("response_code")] - public string ResponseCode { get; set; } + public string? ResponseCode { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/WeChatWorkMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/WeChatWorkMessage.cs index 9fce54397..0e280736d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/WeChatWorkMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Messages/WeChatWorkMessage.cs @@ -14,21 +14,21 @@ public abstract class WeChatWorkMessage : WeChatWorkRequest /// [JsonProperty("touser")] [JsonPropertyName("touser")] - public virtual string ToUser { get; set; } + public virtual string? ToUser { get; set; } /// /// 指定接收消息的部门,部门ID列表,多个接收者用‘|’分隔,最多支持100个。 /// 当touser为"@all"时忽略本参数 /// [JsonProperty("toparty")] [JsonPropertyName("toparty")] - public virtual string ToParty { get; set; } + public virtual string? ToParty { get; set; } /// /// 指定接收消息的标签,标签ID列表,多个接收者用‘|’分隔,最多支持100个。 /// 当touser为"@all"时忽略本参数 /// [JsonProperty("totag")] [JsonPropertyName("totag")] - public virtual string ToTag { get; set; } + public virtual string? ToTag { get; set; } /// /// 消息类型 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/NumberToStringConverter.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/NumberToStringConverter.cs index dcba8ef12..6aea2b91c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/NumberToStringConverter.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/NumberToStringConverter.cs @@ -14,7 +14,7 @@ internal class NumberToStringConverter : JsonConverter } if (reader.TokenType == JsonTokenType.String) { - return reader.GetString(); + return reader.GetString()!; } throw new JsonException("Unexpected token type"); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Security/Models/WeChatDomainModel.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Security/Models/WeChatDomainModel.cs index 0105cb67d..c7432212e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Security/Models/WeChatDomainModel.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Security/Models/WeChatDomainModel.cs @@ -16,7 +16,7 @@ public class WeChatDomainModel /// [JsonProperty("universal_domian")] [JsonPropertyName("universal_domian")] - public string UniversalDomian { get; set; } + public string? UniversalDomian { get; set; } /// /// 协议 如TCP UDP /// @@ -40,5 +40,5 @@ public class WeChatDomainModel /// [JsonProperty("description")] [JsonPropertyName("description")] - public string Description { get; set; } + public string? Description { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Security/Models/WeChatIpModel.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Security/Models/WeChatIpModel.cs index ab8e0e4bc..ab3e34800 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Security/Models/WeChatIpModel.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Security/Models/WeChatIpModel.cs @@ -34,5 +34,5 @@ public class WeChatIpModel /// [JsonProperty("description")] [JsonPropertyName("description")] - public string Description { get; set; } + public string? Description { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkToken.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkToken.cs index bdcff3ae3..a516f649a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkToken.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkToken.cs @@ -8,7 +8,7 @@ public class WeChatWorkToken /// /// 访问令牌 /// - public string AccessToken { get; set; } + public string AccessToken { get; set; } = default!; /// /// 过期时间,单位(s) /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenCacheItem.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenCacheItem.cs index 6208bb9b2..257becc7e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenCacheItem.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenCacheItem.cs @@ -2,11 +2,11 @@ public class WeChatWorkTokenCacheItem { - public string CorpId { get; set; } + public string CorpId { get; set; } = default!; - public string AgentId { get; set; } + public string AgentId { get; set; } = default!; - public WeChatWorkToken Token { get; set; } + public WeChatWorkToken Token { get; set; } = default!; public WeChatWorkTokenCacheItem() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenRequest.cs index c988da881..dd9364b83 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenRequest.cs @@ -4,4 +4,9 @@ public class WeChatWorkTokenRequest { public string CorpId { get; set; } public string CorpSecret { get; set; } + public WeChatWorkTokenRequest(string corpId, string corpSecret) + { + CorpId = corpId; + CorpSecret = corpSecret; + } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenResponse.cs index 3f4be9126..8ebd19ee2 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenResponse.cs @@ -13,7 +13,7 @@ public class WeChatWorkTokenResponse : WeChatWorkResponse /// [JsonProperty("access_token")] [JsonPropertyName("access_token")] - public string AccessToken { get; set; } + public string AccessToken { get; set; } = default!; /// /// 过期时间,单位(s) /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/WeChatWorkTokenProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/WeChatWorkTokenProvider.cs index de2aeea5d..c2ab7d595 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/WeChatWorkTokenProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/WeChatWorkTokenProvider.cs @@ -3,6 +3,7 @@ using LINGYUN.Abp.WeChat.Work.Token.Models; using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Caching; using Volo.Abp.DependencyInjection; using Volo.Abp.Settings; @@ -26,6 +27,10 @@ public class WeChatWorkTokenProvider : WeChatWorkTokenProviderBase, IWeChatWorkT var agentId = await SettingProvider.GetOrNullAsync(WeChatWorkSettingNames.Connection.AgentId); var secret = await SettingProvider.GetOrNullAsync(WeChatWorkSettingNames.Connection.Secret); + Check.NotNullOrWhiteSpace(corpId, nameof(corpId)); + Check.NotNullOrWhiteSpace(agentId, nameof(agentId)); + Check.NotNullOrWhiteSpace(secret, nameof(secret)); + return await GetTokenAsync(corpId, agentId, secret, cancellationToken); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/WeChatWorkTokenProviderBase.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/WeChatWorkTokenProviderBase.cs index f7dc540d8..c8a96d7d6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/WeChatWorkTokenProviderBase.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/WeChatWorkTokenProviderBase.cs @@ -84,11 +84,7 @@ public abstract class WeChatWorkTokenProviderBase var client = HttpClientFactory.CreateWeChatWorkApiClient(); - var request = new WeChatWorkTokenRequest - { - CorpId = corpId, - CorpSecret = secret, - }; + var request = new WeChatWorkTokenRequest(corpId, secret); var tokenResponse = await client.GetTokenAsync(request, cancellationToken); var token = tokenResponse.ToWeChatWorkToken(); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/WeChatWorkResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/WeChatWorkResponse.cs index 2995de067..9867f916a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/WeChatWorkResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/WeChatWorkResponse.cs @@ -20,7 +20,7 @@ public class WeChatWorkResponse /// [JsonProperty("errmsg")] [JsonPropertyName("errmsg")] - public string ErrorMessage { get; set; } + public string? ErrorMessage { get; set; } public bool IsSuccessed => ErrorCode == 0; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/Microsoft/Extensions/DependencyInjection/IHttpClientFactoryWeChatWorkExtensions.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/Microsoft/Extensions/DependencyInjection/IHttpClientFactoryWeChatWorkExtensions.cs index db1ef7009..8cc8974b7 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/Microsoft/Extensions/DependencyInjection/IHttpClientFactoryWeChatWorkExtensions.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/Microsoft/Extensions/DependencyInjection/IHttpClientFactoryWeChatWorkExtensions.cs @@ -5,7 +5,7 @@ using System.Net.Http; namespace Microsoft.Extensions.DependencyInjection; public static class IHttpClientFactoryWeChatWorkExtensions { - internal static IServiceCollection AddApiClient(this IServiceCollection services, Action configureClient = null) + internal static IServiceCollection AddApiClient(this IServiceCollection services, Action? configureClient = null) { services.AddHttpClient(AbpWeChatWorkGlobalConsts.ApiClient, options => @@ -23,7 +23,7 @@ public static class IHttpClientFactoryWeChatWorkExtensions return httpClientFactory.CreateClient(AbpWeChatWorkGlobalConsts.ApiClient); } - internal static IServiceCollection AddOAuthClient(this IServiceCollection services, Action configureClient = null) + internal static IServiceCollection AddOAuthClient(this IServiceCollection services, Action? configureClient = null) { services.AddHttpClient(AbpWeChatWorkGlobalConsts.OAuthClient, options => @@ -41,7 +41,7 @@ public static class IHttpClientFactoryWeChatWorkExtensions return httpClientFactory.CreateClient(AbpWeChatWorkGlobalConsts.OAuthClient); } - internal static IServiceCollection AddLoginClient(this IServiceCollection services, Action configureClient = null) + internal static IServiceCollection AddLoginClient(this IServiceCollection services, Action? configureClient = null) { services.AddHttpClient(AbpWeChatWorkGlobalConsts.LoginClient, options => diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Media.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Media.cs index 687b7a0af..1c179f333 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Media.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Media.cs @@ -41,7 +41,7 @@ internal static partial class HttpClientWeChatWorkRequestExtensions HttpMethod.Post, urlBuilder.ToString()) { - Content = WeChatWorkHttpContentBuildHelper.BuildUploadMediaContent("media", fileBytes, request.Content.FileName) + Content = WeChatWorkHttpContentBuildHelper.BuildUploadMediaContent("media", fileBytes, request.Content.FileName!) }; using var httpResponse = await client.SendAsync(httpRequest, cancellationToken); @@ -63,7 +63,7 @@ internal static partial class HttpClientWeChatWorkRequestExtensions HttpMethod.Post, urlBuilder.ToString()) { - Content = WeChatWorkHttpContentBuildHelper.BuildUploadMediaContent("file", fileBytes, request.Content.FileName) + Content = WeChatWorkHttpContentBuildHelper.BuildUploadMediaContent("file", fileBytes, request.Content.FileName!) }; using var httpResponse = await client.SendAsync(httpRequest, cancellationToken); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IUserWeChatOpenIdFinder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IUserWeChatOpenIdFinder.cs index 92badcebd..1b85d6033 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IUserWeChatOpenIdFinder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IUserWeChatOpenIdFinder.cs @@ -5,7 +5,7 @@ namespace LINGYUN.Abp.WeChat.OpenId; public interface IUserWeChatOpenIdFinder { - Task FindByUserIdAsync(Guid userId, string provider); + Task FindByUserIdAsync(Guid userId, string provider); - Task FindByUserNameAsync(string userName, string provider); + Task FindByUserNameAsync(string userName, string provider); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IWeChatOpenIdFinder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IWeChatOpenIdFinder.cs index b604dfe58..189bcde44 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IWeChatOpenIdFinder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IWeChatOpenIdFinder.cs @@ -4,7 +4,7 @@ namespace LINGYUN.Abp.WeChat.OpenId; public interface IWeChatOpenIdFinder { - Task FindAsync(string code, string appId, string appSecret); + Task FindAsync(string code, string appId, string appSecret); /// /// 获取当前登录用户OpenId /// @@ -12,5 +12,5 @@ public interface IWeChatOpenIdFinder /// /// 用户未登录时 /// 微信sessionKey过期时 - Task FindAsync(string appId); + Task FindAsync(string appId); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/NullUserWeChatOpenIdFinder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/NullUserWeChatOpenIdFinder.cs index 0e22fc601..cfbee7e9d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/NullUserWeChatOpenIdFinder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/NullUserWeChatOpenIdFinder.cs @@ -6,13 +6,13 @@ namespace LINGYUN.Abp.WeChat.OpenId; public class NullUserWeChatOpenIdFinder : IUserWeChatOpenIdFinder, ISingletonDependency { - public Task FindByUserIdAsync(Guid userId, string provider) + public Task FindByUserIdAsync(Guid userId, string provider) { - return Task.FromResult(""); + return Task.FromResult(null); } - public Task FindByUserNameAsync(string userName, string provider) + public Task FindByUserNameAsync(string userName, string provider) { - return Task.FromResult(""); + return Task.FromResult(null); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenId.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenId.cs index 5ded29e1b..c3c17fcb6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenId.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenId.cs @@ -5,22 +5,22 @@ public class WeChatOpenId /// /// 用户在开放平台的唯一标识符,在满足 UnionID 下发条件的情况下会返回 /// - public string UnionId { get; set; } + public string? UnionId { get; set; } /// /// 用户唯一标识 /// - public string OpenId { get; set; } + public string OpenId { get; set; } = default!; /// /// 会话密钥 /// - public string SessionKey { get; set; } + public string SessionKey { get; set; } = default!; public WeChatOpenId() { } - public WeChatOpenId(string openId, string sessionKey, string unionId = null) + public WeChatOpenId(string openId, string sessionKey, string? unionId = null) { OpenId = openId; SessionKey = sessionKey; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdCacheItem.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdCacheItem.cs index c8543d874..971678875 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdCacheItem.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdCacheItem.cs @@ -4,9 +4,10 @@ namespace LINGYUN.Abp.WeChat.OpenId; public class WeChatOpenIdCacheItem { - public string Code { get; set; } + public string Code { get; set; } = default!; + + public WeChatOpenId WeChatOpenId { get; set; } = default!; - public WeChatOpenId WeChatOpenId { get; set; } public WeChatOpenIdCacheItem() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdFinder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdFinder.cs index ac64fa84d..b7bba0779 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdFinder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdFinder.cs @@ -39,19 +39,19 @@ public class WeChatOpenIdFinder : IWeChatOpenIdFinder Logger = NullLogger.Instance; } - public async virtual Task FindAsync(string appId) + public async virtual Task FindAsync(string appId) { if (!CurrentUser.IsAuthenticated) { throw new AbpAuthorizationException("Try to get wechat information when the user is not logged in!"); } - var cacheKey = WeChatOpenIdCacheItem.CalculateCacheKey(appId, CurrentUser.Id.Value); + var cacheKey = WeChatOpenIdCacheItem.CalculateCacheKey(appId, CurrentUser.GetId()); var openIdCache = await Cache.GetAsync(cacheKey); return openIdCache?.WeChatOpenId ?? throw new AbpException("The wechat login session has expired. Use 'wx.login' result code to exchange the sessionKey"); } - public async virtual Task FindAsync(string code, string appId, string appSecret) + public async virtual Task FindAsync(string code, string appId, string appSecret) { // TODO: 如果需要获取SessionKey的话呢,需要再以openid作为标识来缓存一下吗 // 或者前端保存code,通过传递code来获取 @@ -78,7 +78,7 @@ public class WeChatOpenIdFinder : IWeChatOpenIdFinder var request = new WeChatOpenIdRequest { - BaseUrl = client.BaseAddress.AbsoluteUri, + BaseUrl = client.BaseAddress!.AbsoluteUri, AppId = appId, Secret = appSecret, Code = code @@ -87,7 +87,7 @@ public class WeChatOpenIdFinder : IWeChatOpenIdFinder var response = await client.RequestWeChatOpenIdAsync(request); var responseContent = await response.Content.ReadAsStringAsync(); // 改为直接引用 Newtownsoft.Json - var weChatOpenIdResponse = JsonConvert.DeserializeObject(responseContent); + var weChatOpenIdResponse = JsonConvert.DeserializeObject(responseContent)!; var weChatOpenId = weChatOpenIdResponse.ToWeChatOpenId(); cacheItem = new WeChatOpenIdCacheItem(code, weChatOpenId); @@ -106,7 +106,7 @@ public class WeChatOpenIdFinder : IWeChatOpenIdFinder if (CurrentUser.IsAuthenticated) { - await Cache.SetAsync(WeChatOpenIdCacheItem.CalculateCacheKey(appId, CurrentUser.Id.Value), cacheItem, cacheOptions); + await Cache.SetAsync(WeChatOpenIdCacheItem.CalculateCacheKey(appId, CurrentUser.GetId()), cacheItem, cacheOptions); } Logger.LogDebug($"Finished setting the cache item: {cacheKey}"); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdRequest.cs index b648b1e96..6a1956845 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdRequest.cs @@ -2,8 +2,8 @@ public class WeChatOpenIdRequest { - public string BaseUrl { get; set; } - public string AppId { get; set; } - public string Secret { get; set; } - public string Code { get; set; } + public string BaseUrl { get; set; } = default!; + public string AppId { get; set; } = default!; + public string Secret { get; set; } = default!; + public string Code { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdResponse.cs index 7bd009601..07d0db876 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdResponse.cs @@ -13,22 +13,22 @@ public class WeChatOpenIdResponse /// 错误码 /// [JsonProperty("errcode")] - public string ErrorCode { get; set; } + public string ErrorCode { get; set; } = default!; /// /// 会话密钥 /// [JsonProperty("session_key")] - public string SessionKey { get; set; } + public string SessionKey { get; set; } = default!; /// /// 用户唯一标识 /// [JsonProperty("openid")] - public string OpenId { get; set; } + public string OpenId { get; set; } = default!; /// /// 用户在开放平台的唯一标识符,在满足 UnionID 下发条件的情况下会返回 /// [JsonProperty("unionid")] - public string UnionId { get; set; } + public string? UnionId { get; set; } /// /// 错误消息 /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatToken.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatToken.cs index 267f622e8..b6358f7ba 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatToken.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatToken.cs @@ -8,7 +8,7 @@ public class WeChatToken /// /// 访问令牌 /// - public string AccessToken { get; set; } + public string AccessToken { get; set; } = default!; /// /// 过期时间,单位(s) /// diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenCacheItem.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenCacheItem.cs index 8560683e3..729ede20d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenCacheItem.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenCacheItem.cs @@ -2,9 +2,9 @@ public class WeChatTokenCacheItem { - public string AppId { get; set; } + public string AppId { get; set; } = default!; - public WeChatToken WeChatToken { get; set; } + public WeChatToken WeChatToken { get; set; } = default!; public WeChatTokenCacheItem() { diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenProvider.cs index ef32df947..3d1cce9ca 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenProvider.cs @@ -59,7 +59,7 @@ public class WeChatTokenProvider : IWeChatTokenProvider, ISingletonDependency var request = new WeChatTokenRequest { - BaseUrl = client.BaseAddress.AbsoluteUri, + BaseUrl = client.BaseAddress!.AbsoluteUri, AppSecret = appSecret, AppId = appId, GrantType = "client_credential" @@ -68,7 +68,7 @@ public class WeChatTokenProvider : IWeChatTokenProvider, ISingletonDependency var response = await client.RequestWeChatCodeTokenAsync(request, cancellationToken); var responseContent = await response.Content.ReadAsStringAsync(); // 改为直接引用 Newtownsoft.Json - var weChatTokenResponse = JsonConvert.DeserializeObject(responseContent); + var weChatTokenResponse = JsonConvert.DeserializeObject(responseContent)!; var weChatToken = weChatTokenResponse.ToWeChatToken(); cacheItem = new WeChatTokenCacheItem(appId, weChatToken); diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenRequest.cs index 5e14dd790..089e008ab 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenRequest.cs @@ -2,8 +2,8 @@ public class WeChatTokenRequest { - public string BaseUrl { get; set; } - public string GrantType { get; set; } - public string AppId { get; set; } - public string AppSecret { get; set; } + public string BaseUrl { get; set; } = default!; + public string GrantType { get; set; } = default!; + public string AppId { get; set; } = default!; + public string AppSecret { get; set; } = default!; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenResponse.cs index 5eb5074ed..8212a70fe 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenResponse.cs @@ -12,17 +12,17 @@ public class WeChatTokenResponse /// 错误码 /// [JsonProperty("errcode")] - public int ErrorCode { get; set; } + public int ErrorCode { get; set; } = default!; /// /// 错误消息 /// [JsonProperty("errmsg")] - public string ErrorMessage { get; set; } + public string? ErrorMessage { get; set; } /// /// 访问令牌 /// [JsonProperty("access_token")] - public string AccessToken { get; set; } + public string AccessToken { get; set; } = default!; /// /// 过期时间,单位(s) /// @@ -33,7 +33,7 @@ public class WeChatTokenResponse { if(ErrorCode != 0) { - throw new AbpWeChatException(ErrorCode.ToString(), ErrorMessage); + throw new AbpWeChatException(ErrorCode.ToString(), ErrorMessage!); } return new WeChatToken(AccessToken, ExpiresIn); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/WeChatResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/WeChatResponse.cs index 3301c9e09..b609def69 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/WeChatResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/WeChatResponse.cs @@ -21,7 +21,7 @@ public class WeChatResponse /// [JsonProperty("errmsg")] [JsonPropertyName("errmsg")] - public string ErrorMessage { get; set; } + public string? ErrorMessage { get; set; } public bool IsSuccessed => ErrorCode == 0; diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/System/WeChatResponseDeserializeExtensions.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/System/WeChatResponseDeserializeExtensions.cs index 6d8abda93..69d00ca82 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/System/WeChatResponseDeserializeExtensions.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/System/WeChatResponseDeserializeExtensions.cs @@ -6,6 +6,6 @@ public static class WeChatResponseDeserializeExtensions { public static T DeserializeObject(this string responseContent) where T : WeChatResponse { - return JsonConvert.DeserializeObject(responseContent); + return JsonConvert.DeserializeObject(responseContent)!; } } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingAppService.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingAppService.cs index 12158e5ce..69ef3ee5e 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingAppService.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingAppService.cs @@ -38,7 +38,7 @@ public class WxPusherSettingAppService : ApplicationService, IWxPusherSettingApp return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); } - protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + protected async virtual Task GetAllForProviderAsync(string providerName, string? providerKey = null) { var settingGroups = new SettingGroupResult(); var wxPusherSettingGroup = new SettingGroupDto(L["DisplayName:WxPusher"], L["Description:WxPusher"]); diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/IWxPusherMessageSender.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/IWxPusherMessageSender.cs index 92b2a16d2..46fe3bad4 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/IWxPusherMessageSender.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/IWxPusherMessageSender.cs @@ -8,10 +8,10 @@ public interface IWxPusherMessageSender { Task> SendAsync( string content, - string summary = "", + string? summary = null, MessageContentType contentType = MessageContentType.Text, - List topicIds = null, - List uids = null, - string url = "", + List? topicIds = null, + List? uids = null, + string? url = null, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/SendMessage.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/SendMessage.cs index 70a1da1a7..fd27af422 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/SendMessage.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/SendMessage.cs @@ -16,7 +16,7 @@ public class SendMessage public string Content { get; } [JsonProperty("summary")] - public string Summary { get; set; } + public string? Summary { get; set; } [JsonProperty("contentType")] public MessageContentType ContentType { get; } @@ -28,13 +28,13 @@ public class SendMessage public List Uids { get; } [JsonProperty("url")] - public string Url { get; } + public string? Url { get; } public SendMessage( [NotNull] string appToken, [NotNull] string content, - string summary = "", + string? summary = null, MessageContentType contentType = MessageContentType.Text, - string url = "") + string? url = null) { AppToken = Check.NotNullOrWhiteSpace(appToken, nameof(appToken)); // 单条消息的数据长度(字符数)限制是:content<40000;summary<20(微信的限制,大于20显示不完);url<400 diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/SendMessageResult.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/SendMessageResult.cs index b538c3912..76a4744be 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/SendMessageResult.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/SendMessageResult.cs @@ -10,7 +10,7 @@ public class SendMessageResult /// 状态码 /// [JsonProperty("code")] - public int Code { get; set; } + public int Code { get; set; } = default!; /// /// 消息标识 /// @@ -38,12 +38,12 @@ public class SendMessageResult /// 状态 /// [JsonProperty("status")] - public string Status { get; set; } + public string Status { get; set; } = default!; /// /// 用户标识 /// [JsonProperty("uid")] - public string Uid { get; set; } + public string Uid { get; set; } = default!; /// /// 群组标识 /// diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/WxPusherMessageSender.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/WxPusherMessageSender.cs index 3dce961b3..b456aa284 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/WxPusherMessageSender.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Messages/WxPusherMessageSender.cs @@ -25,12 +25,12 @@ public class WxPusherMessageSender : WxPusherRequestProvider, IWxPusherMessageSe WxPusherFeatureNames.Message.SendLimitInterval, LimitPolicy.Days)] public async virtual Task> SendAsync( - string content, - string summary = "", - MessageContentType contentType = MessageContentType.Text, - List topicIds = null, - List uids = null, - string url = "", + string content, + string? summary = null, + MessageContentType contentType = MessageContentType.Text, + List? topicIds = null, + List? uids = null, + string? url = null, CancellationToken cancellationToken = default) { var token = await WxPusherTokenProvider.GetTokenAsync(cancellationToken); diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/QrCode/CreateQrcodeResult.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/QrCode/CreateQrcodeResult.cs index c8021becb..ff64236b6 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/QrCode/CreateQrcodeResult.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/QrCode/CreateQrcodeResult.cs @@ -10,14 +10,14 @@ public class CreateQrcodeResult public long Expires { get; set; } [JsonProperty("code")] - public string Code { get; set; } + public string Code { get; set; } = default!; [JsonProperty("shortUrl")] - public string ShortUrl { get; set; } + public string ShortUrl { get; set; } = default!; [JsonProperty("url")] - public string Url { get; set; } + public string Url { get; set; } = default!; [JsonProperty("extra")] - public string Extra { get; set; } + public string? Extra { get; set; } } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/QrCode/GetScanQrCodeResult.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/QrCode/GetScanQrCodeResult.cs index a16663f5c..49fe3c31f 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/QrCode/GetScanQrCodeResult.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/QrCode/GetScanQrCodeResult.cs @@ -10,26 +10,26 @@ public class GetScanQrCodeResult public int AppId { get; set; } [JsonProperty("appKey")] - public string AppKey { get; set; } + public string AppKey { get; set; } = default!; [JsonProperty("appName")] - public string AppName { get; set; } + public string AppName { get; set; } = default!; [JsonProperty("extra")] - public string Extra { get; set; } + public string? Extra { get; set; } [JsonProperty("source")] - public string Source { get; set; } + public string? Source { get; set; } [JsonProperty("time")] public long Time { get; set; } [JsonProperty("uid")] - public string Uid { get; set; } + public string? Uid { get; set; } [JsonProperty("userHeadImg")] - public string UserHeadImg { get; set; } + public string? UserHeadImg { get; set; } [JsonProperty("userName")] - public string UserName { get; set; } + public string? UserName { get; set; } } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Token/WxPusherTokenProvider.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Token/WxPusherTokenProvider.cs index 35087fff2..f8a3d2c14 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Token/WxPusherTokenProvider.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Token/WxPusherTokenProvider.cs @@ -1,6 +1,7 @@ using LINGYUN.Abp.WxPusher.Settings; using System.Threading; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.DependencyInjection; using Volo.Abp.Settings; @@ -17,7 +18,10 @@ public class WxPusherTokenProvider : IWxPusherTokenProvider, ITransientDependenc public async virtual Task GetTokenAsync(CancellationToken cancellationToken = default) { - return await SettingProvider.GetOrNullAsync( - WxPusherSettingNames.Security.AppToken); + var appToken = await SettingProvider.GetOrNullAsync(WxPusherSettingNames.Security.AppToken); + + Check.NotNullOrWhiteSpace(appToken, nameof(appToken)); + + return appToken; } } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/IWxPusherUserProvider.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/IWxPusherUserProvider.cs index 9c3cafd4c..95f3043c1 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/IWxPusherUserProvider.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/IWxPusherUserProvider.cs @@ -23,7 +23,7 @@ public interface IWxPusherUserProvider Task> GetUserListAsync( int page = 1, int pageSize = 10, - string uid = null, + string? uid = null, bool? isBlock = null, FlowType? type = null, CancellationToken cancellationToken = default); diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/UserHttpClientExtensions.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/UserHttpClientExtensions.cs index e80b2d116..bbc86fb26 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/UserHttpClientExtensions.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/UserHttpClientExtensions.cs @@ -11,7 +11,7 @@ internal static class UserHttpClientExtensions string appToken, int page = 1, int pageSize = 10, - string uid = null, + string? uid = null, bool? isBlock = null, FlowType? type = null, CancellationToken cancellationToken = default) diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/UserProfile.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/UserProfile.cs index 01abe77af..d03c1c487 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/UserProfile.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/UserProfile.cs @@ -10,7 +10,7 @@ public class UserProfile /// 用户uid /// [JsonProperty("uid")] - public string Uid { get; set; } + public string Uid { get; set; } = default!; /// /// 用户关注的应用或者主题id,根据type来区分 /// @@ -20,7 +20,7 @@ public class UserProfile /// 新用户微信不再返回 ,强制返回空 /// [JsonProperty("headImg")] - public string HeadImg { get; set; } + public string? HeadImg { get; set; } /// /// 创建时间 /// @@ -30,7 +30,7 @@ public class UserProfile /// 新用户微信不再返回 ,强制返回空 /// [JsonProperty("nickName")] - public string NickName { get; set; } + public string? NickName { get; set; } /// /// 是否拉黑 /// @@ -52,7 +52,7 @@ public class UserProfile /// 关注的应用或者主题名字 /// [JsonProperty("target")] - public string Target { get; set; } + public string? Target { get; set; } /// /// 0表示用户不是付费用户,大于0表示用户付费订阅到期时间,毫秒级时间戳 /// diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/WxPusherUserProvider.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/WxPusherUserProvider.cs index 9018cc96c..568cf4903 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/WxPusherUserProvider.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/User/WxPusherUserProvider.cs @@ -38,7 +38,7 @@ public class WxPusherUserProvider : WxPusherRequestProvider, IWxPusherUserProvid public async virtual Task> GetUserListAsync( int page = 1, int pageSize = 10, - string uid = null, + string? uid = null, bool? isBlock = null, FlowType? type = null, CancellationToken cancellationToken = default) diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/WxPusherRequestProvider.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/WxPusherRequestProvider.cs index dc69bedbb..ed95c1f76 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/WxPusherRequestProvider.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/WxPusherRequestProvider.cs @@ -8,10 +8,10 @@ namespace LINGYUN.Abp.WxPusher; public abstract class WxPusherRequestProvider : ITransientDependency { - public IAbpLazyServiceProvider LazyServiceProvider { get; set; } + public IAbpLazyServiceProvider LazyServiceProvider { get; set; } = default!; protected ILoggerFactory LoggerFactory => LazyServiceProvider.LazyGetRequiredService(); - protected ILogger Logger => LazyServiceProvider.LazyGetService(provider => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance); + protected ILogger Logger => LazyServiceProvider.LazyGetService(provider => LoggerFactory?.CreateLogger(GetType().FullName!) ?? NullLogger.Instance); protected IJsonSerializer JsonSerializer => LazyServiceProvider.LazyGetRequiredService(); protected IHttpClientFactory HttpClientFactory => LazyServiceProvider.LazyGetRequiredService(); } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/WxPusherResult.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/WxPusherResult.cs index bdd8fc7bd..a48259f82 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/WxPusherResult.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/WxPusherResult.cs @@ -15,12 +15,12 @@ public class WxPusherResult /// 错误消息 /// [JsonProperty("msg")] - public string Message { get; set; } + public string? Message { get; set; } /// /// 返回数据 /// [JsonProperty("data")] - public T Data { get; set; } + public T? Data { get; set; } /// /// 是否调用成功 /// @@ -48,14 +48,14 @@ public class WxPusherResult { ThrowOfFailed(); - return Data; + return Data!; } public void ThrowOfFailed() { if (!Success) { - throw new WxPusherRemoteCallException(Code.ToString(), Message); + throw new WxPusherRemoteCallException(Code.ToString(), Message!); } } } diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/IdentityClaimTypeDataSeedContributor.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/IdentityClaimTypeDataSeedContributor.cs index e3b348dfd..f86df18e1 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/IdentityClaimTypeDataSeedContributor.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/IdentityClaimTypeDataSeedContributor.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 IdentityClaimTypeDataSeedContributor : IDataSeedContributor, ITrans GuidGenerator = guidGenerator; IdentityClaimTypeManager = identityClaimTypeManager; IdentityClaimTypeRepository = identityClaimTypeRepository; + + Logger = NullLogger.Instance; } public async virtual Task SeedAsync(DataSeedContext context) @@ -67,9 +70,9 @@ public class IdentityClaimTypeDataSeedContributor : IDataSeedContributor, ITrans [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)) diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs index 5fa401278..5d1460f29 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs @@ -115,7 +115,7 @@ public class SingleDbMigrationEventHandler : Source = JobSource.System, LockTimeOut = Options.JobFetchLockTimeOut, TenantId = tenantId, - Type = typeof(BackgroundPollingJob).AssemblyQualifiedName, + Type = typeof(BackgroundPollingJob).AssemblyQualifiedName!, }; } @@ -136,7 +136,7 @@ public class SingleDbMigrationEventHandler : Priority = JobPriority.High, Source = JobSource.System, TenantId = tenantId, - Type = typeof(BackgroundCleaningJob).AssemblyQualifiedName, + Type = typeof(BackgroundCleaningJob).AssemblyQualifiedName!, }; } @@ -158,7 +158,7 @@ public class SingleDbMigrationEventHandler : Priority = JobPriority.High, Source = JobSource.System, TenantId = tenantId, - Type = typeof(BackgroundCheckingJob).AssemblyQualifiedName, + Type = typeof(BackgroundCheckingJob).AssemblyQualifiedName!, }; } } diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationService.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationService.cs index 785379884..90da79a0c 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationService.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationService.cs @@ -1,14 +1,9 @@ -using LINGYUN.Abp.Saas.Tenants; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging; using System; -using System.Linq; using System.Threading.Tasks; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; using Volo.Abp.DistributedLocking; -using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.Migrations; using Volo.Abp.EventBus.Distributed; using Volo.Abp.MultiTenancy; @@ -19,7 +14,6 @@ namespace LY.MicroService.Applications.Single.EntityFrameworkCore; public class SingleDbMigrationService : EfCoreRuntimeDatabaseMigratorBase, ITransientDependency { protected IDataSeeder DataSeeder { get; } - protected ITenantRepository TenantRepository { get; } public SingleDbMigrationService( IUnitOfWorkManager unitOfWorkManager, IServiceProvider serviceProvider, @@ -27,77 +21,16 @@ public class SingleDbMigrationService : EfCoreRuntimeDatabaseMigratorBase(), unitOfWorkManager, serviceProvider, currentTenant, abpDistributedLock, distributedEventBus, loggerFactory) { DataSeeder = dataSeeder; - TenantRepository = tenantRepository; - } - protected async override Task LockAndApplyDatabaseMigrationsAsync() - { - await base.LockAndApplyDatabaseMigrationsAsync(); - - var tenants = await TenantRepository.GetListAsync(); - foreach (var tenant in tenants.Where(x => x.IsActive)) - { - Logger.LogInformation($"Trying to acquire the distributed lock for database migration: {DatabaseName} with tenant: {tenant.Name}."); - - var schemaMigrated = false; - - await using (var handle = await DistributedLock.TryAcquireAsync("DatabaseMigration_" + DatabaseName + "_Tenant" + tenant.Id.ToString())) - { - if (handle is null) - { - Logger.LogInformation($"Distributed lock could not be acquired for database migration: {DatabaseName} with tenant: {tenant.Name}. Operation cancelled."); - return; - } - - Logger.LogInformation($"Distributed lock is acquired for database migration: {DatabaseName} with tenant: {tenant.Name}..."); - - using (CurrentTenant.Change(tenant.Id)) - { - // Create database tables if needed - using var uow = UnitOfWorkManager.Begin(requiresNew: true, isTransactional: false); - var dbContext = await ServiceProvider - .GetRequiredService>() - .GetDbContextAsync(); - - var pendingMigrations = await dbContext - .Database - .GetPendingMigrationsAsync(); - - if (pendingMigrations.Any()) - { - await dbContext.Database.MigrateAsync(); - schemaMigrated = true; - } - - await uow.CompleteAsync(); - - await SeedAsync(); - - if (schemaMigrated || AlwaysSeedTenantDatabases) - { - await DistributedEventBus.PublishAsync( - new AppliedDatabaseMigrationsEto - { - DatabaseName = DatabaseName, - TenantId = tenant.Id - } - ); - } - } - } - - Logger.LogInformation($"Distributed lock has been released for database migration: {DatabaseName} with tenant: {tenant.Name}..."); - } } protected async override Task SeedAsync() { - await DataSeeder.SeedAsync(CurrentTenant.Id); + await DataSeeder.SeedAsync(new DataSeedContext()); } } \ No newline at end of file diff --git a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs index 1b17c95f1..a96480053 100644 --- a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs +++ b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityClaimTypeDataSeeder.cs @@ -70,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) { Logger.LogInformation("Check claim types {name} exists.", name); diff --git a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs index 26d77aa0f..59237a2d6 100644 --- a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs +++ b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/IdentityUserRoleDataSeeder.cs @@ -67,7 +67,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; @@ -91,7 +91,7 @@ public class IdentityUserRoleDataSeeder : ITransientDependency else { var adminRole = await RoleManager.FindByNameAsync(adminRoleName); - adminRoleId = adminRole.Id; + adminRoleId = adminRole!.Id; } var adminUserId = GuidGenerator.Create(); @@ -100,8 +100,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; Logger.LogInformation("Check admin user {adminUserName} exists.", adminUserName); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/AuthenticatorDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/AuthenticatorDto.cs index 62114d7ca..3f49b5c2a 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/AuthenticatorDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/AuthenticatorDto.cs @@ -2,6 +2,6 @@ public class AuthenticatorDto { public bool IsAuthenticated { get; set; } - public string SharedKey { get; set; } - public string AuthenticatorUri { get; set; } + public string? SharedKey { get; set; } + public string? AuthenticatorUri { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/AuthenticatorRecoveryCodeDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/AuthenticatorRecoveryCodeDto.cs index 417d42d2f..b90b513c1 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/AuthenticatorRecoveryCodeDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/AuthenticatorRecoveryCodeDto.cs @@ -3,5 +3,5 @@ namespace LINGYUN.Abp.Account; public class AuthenticatorRecoveryCodeDto { - public List RecoveryCodes { get; set; } + public List? RecoveryCodes { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeAvatarInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeAvatarInput.cs deleted file mode 100644 index 6ecd90872..000000000 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeAvatarInput.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Volo.Abp.Identity; -using Volo.Abp.Validation; - -namespace LINGYUN.Abp.Account; - -public class ChangeAvatarInput -{ - [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] - public string AvatarUrl { get; set; } -} diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePhoneNumberInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePhoneNumberInput.cs index ef92f1f92..a382e9d4d 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePhoneNumberInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePhoneNumberInput.cs @@ -14,7 +14,7 @@ public class ChangePhoneNumberInput [Phone] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] [Display(Name = "PhoneNumber")] - public string NewPhoneNumber { get; set; } + public string NewPhoneNumber { get; set; } = default!; /// /// 安全验证码 /// @@ -22,5 +22,5 @@ public class ChangePhoneNumberInput [DisableAuditing] [StringLength(6, MinimumLength = 6)] [Display(Name = "SmsVerifyCode")] - public string Code { get; set; } + public string Code { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePictureInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePictureInput.cs index 5c4d0314d..ab3afd622 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePictureInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePictureInput.cs @@ -8,5 +8,5 @@ public class ChangePictureInput { [Required] [DisableAuditing] - public IRemoteStreamContent File { get; set; } + public IRemoteStreamContent File { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeUserClaimInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeUserClaimInput.cs deleted file mode 100644 index ce39c0223..000000000 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeUserClaimInput.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using Volo.Abp.Identity; -using Volo.Abp.Validation; - -namespace LINGYUN.Abp.Account; - -public class ChangeUserClaimInput -{ - [Required] - [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimTypeLength))] - public string ClaimType { get; set; } - - [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] - public string ClaimValue { get; set; } -} diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ConfirmEmailInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ConfirmEmailInput.cs index 8e14fb811..6edf3e1bf 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ConfirmEmailInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ConfirmEmailInput.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.Account; public class ConfirmEmailInput { [Required] - public string ConfirmToken { get; set; } + public string ConfirmToken { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ExternalLoginInfoDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ExternalLoginInfoDto.cs index c43952808..539e88c1d 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ExternalLoginInfoDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ExternalLoginInfoDto.cs @@ -1,7 +1,7 @@ namespace LINGYUN.Abp.Account; public class ExternalLoginInfoDto { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/GetMySessionsInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/GetMySessionsInput.cs index c50ce9313..56afec0b7 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/GetMySessionsInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/GetMySessionsInput.cs @@ -6,9 +6,9 @@ public class GetMySessionsInput : PagedAndSortedResultRequestDto /// /// 设备 /// - public string Device { get; set; } + public string? Device { get; set; } /// /// 客户端id /// - public string ClientId { get; set; } + public string? ClientId { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/GetUserClaimStateDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/GetUserClaimStateDto.cs index 5c3d661c8..522a52fbf 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/GetUserClaimStateDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/GetUserClaimStateDto.cs @@ -3,5 +3,5 @@ public class GetUserClaimStateDto { public bool IsBound { get; set; } - public string Value { get; set; } + public string? Value { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/IdentitySessionDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/IdentitySessionDto.cs index bb764eb86..41c8bb8c7 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/IdentitySessionDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/IdentitySessionDto.cs @@ -4,15 +4,15 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.Account; public class IdentitySessionDto : ExtensibleEntityDto { - public string SessionId { get; set; } + public string SessionId { get; set; } = default!; - public string Device { get; set; } + public string? Device { get; set; } - public string DeviceInfo { get; set; } + public string? DeviceInfo { get; set; } - public string ClientId { get; set; } + public string? ClientId { get; set; } - public string IpAddresses { get; set; } + public string? IpAddresses { get; set; } public Guid UserId { get; set; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/LinkUserDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/LinkUserDto.cs index 32707b87b..e5fe60e08 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/LinkUserDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/LinkUserDto.cs @@ -13,7 +13,7 @@ public class LinkUserDto /// /// 关联用户名 /// - public string LinkUserName { get; set; } + public string LinkUserName { get; set; } = default!; /// /// 关联租户Id /// @@ -21,7 +21,7 @@ public class LinkUserDto /// /// 关联租户名 /// - public string LinkTenantName { get; set; } + public string? LinkTenantName { get; set; } /// /// 直接关联 /// diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/LinkUserInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/LinkUserInput.cs index 37c75dfb2..2404383ae 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/LinkUserInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/LinkUserInput.cs @@ -1,5 +1,4 @@ -using System; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; namespace LINGYUN.Abp.Account.Dto; /// @@ -11,5 +10,5 @@ public class LinkUserInput : LinkUserBaseDto /// 关联用户Token /// [Required] - public string Token { get; set; } + public string Token { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneRegisterDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneRegisterDto.cs index 1330f54e3..2c381ef65 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneRegisterDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneRegisterDto.cs @@ -12,30 +12,30 @@ public class PhoneRegisterDto [Phone] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] [Display(Name = "PhoneNumber")] - public string PhoneNumber { get; set; } + public string PhoneNumber { get; set; } = default!; [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxNameLength))] [DisplayName("Name")] - public string Name { get; set; } + public string? Name { get; set; } [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] [DisplayName("UserName")] - public string UserName { get; set; } + public string? UserName { get; set; } [EmailAddress] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxEmailLength))] [DisplayName("EmailAddress")] - public string EmailAddress { get; set; } + public string? EmailAddress { get; set; } [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] [DataType(DataType.Password)] [DisplayName("Password")] [DisableAuditing] - public string Password { get; set; } + public string? Password { get; set; } [Required] [StringLength(6,MinimumLength = 6)] [DisableAuditing] [DisplayName("DisplayName:SmsVerifyCode")] - public string Code { get; set; } + public string Code { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneResetPasswordDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneResetPasswordDto.cs index 3bfbfb88d..fa2a73333 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneResetPasswordDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneResetPasswordDto.cs @@ -10,23 +10,21 @@ public class PhoneResetPasswordDto [Required] [Phone] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] - // 如果Dto属性和本地化内容不一致,需要指定本地化名称如下 // [Display(Name = "DisplayName:RequiredPhoneNumber")] //json本地化文件中必须有相同的格式: DisplayName:RequiredPhoneNumber //[DisplayName("DisplayName:RequiredPhoneNumber")] //两种方法都可以 - // 如果Dto属性与本地化内容一致,不需要显示指定名称,但是本地化文件必须存在对应格式的文本: DisplayName:PhoneNumber - public string PhoneNumber { get; set; } + public string PhoneNumber { get; set; } = default!; [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] [DataType(DataType.Password)] [DisableAuditing] - public string NewPassword { get; set; } + public string NewPassword { get; set; } = default!; [Required] [StringLength(6)] [DisableAuditing] [Display(Name = "DisplayName:SmsVerifyCode")] - public string Code { get; set; } + public string Code { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/RemoveExternalLoginInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/RemoveExternalLoginInput.cs index 2b537020c..88cdfe3f7 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/RemoveExternalLoginInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/RemoveExternalLoginInput.cs @@ -4,8 +4,8 @@ namespace LINGYUN.Abp.Account; public class RemoveExternalLoginInput { [Required] - public string LoginProvider { get; set; } + public string LoginProvider { get; set; } = default!; [Required] - public string ProviderKey { get; set; } + public string ProviderKey { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SecurityLogDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SecurityLogDto.cs index eb5f5ddad..61660e083 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SecurityLogDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SecurityLogDto.cs @@ -5,25 +5,25 @@ namespace LINGYUN.Abp.Account; public class SecurityLogDto : ExtensibleEntityDto { - public string ApplicationName { get; set; } + public string? ApplicationName { get; set; } - public string Identity { get; set; } + public string? Identity { get; set; } - public string Action { get; set; } + public string? Action { get; set; } public Guid? UserId { get; set; } - public string UserName { get; set; } + public string? UserName { get; set; } - public string TenantName { get; set; } + public string? TenantName { get; set; } - public string ClientId { get; set; } + public string? ClientId { get; set; } - public string CorrelationId { get; set; } + public string? CorrelationId { get; set; } - public string ClientIpAddress { get; set; } + public string? ClientIpAddress { get; set; } - public string BrowserInfo { get; set; } + public string? BrowserInfo { get; set; } public DateTime CreationTime { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SecurityLogGetListInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SecurityLogGetListInput.cs index afde4703a..3fe1c3bef 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SecurityLogGetListInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SecurityLogGetListInput.cs @@ -7,9 +7,9 @@ public class SecurityLogGetListInput : PagedAndSortedResultRequestDto { public DateTime? StartTime { get; set; } public DateTime? EndTime { get; set; } - public string ApplicationName { get; set; } - public string Identity { get; set; } - public string ActionName { get; set; } - public string ClientId { get; set; } - public string CorrelationId { get; set; } + public string? ApplicationName { get; set; } + public string? Identity { get; set; } + public string? ActionName { get; set; } + public string? ClientId { get; set; } + public string? CorrelationId { get; set; } } \ No newline at end of file diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendChangePhoneNumberCodeInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendChangePhoneNumberCodeInput.cs index 7f6cb910a..5129cd87e 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendChangePhoneNumberCodeInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendChangePhoneNumberCodeInput.cs @@ -13,5 +13,5 @@ public class SendChangePhoneNumberCodeInput [Phone] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] [Display(Name = "PhoneNumber")] - public string NewPhoneNumber { get; set; } + public string NewPhoneNumber { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendEmailConfirmCodeDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendEmailConfirmCodeDto.cs index 61f906755..9d3ebd832 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendEmailConfirmCodeDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendEmailConfirmCodeDto.cs @@ -10,12 +10,12 @@ public class SendEmailConfirmCodeDto [EmailAddress] [Display(Name = "EmailAddress")] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxEmailLength))] - public string Email { get; set; } + public string Email { get; set; } = default!; [Required] - public string AppName { get; set; } + public string AppName { get; set; } = default!; - public string ReturnUrl { get; set; } + public string? ReturnUrl { get; set; } - public string ReturnUrlHash { get; set; } + public string? ReturnUrlHash { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendEmailSigninCodeDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendEmailSigninCodeDto.cs index b005c0d9c..87dce43ca 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendEmailSigninCodeDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendEmailSigninCodeDto.cs @@ -9,5 +9,5 @@ public class SendEmailSigninCodeDto [EmailAddress] [Display(Name = "EmailAddress")] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxEmailLength))] - public string EmailAddress { get; set; } + public string EmailAddress { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneRegisterCodeDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneRegisterCodeDto.cs index 15701fcc5..000101563 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneRegisterCodeDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneRegisterCodeDto.cs @@ -10,5 +10,5 @@ public class SendPhoneRegisterCodeDto [Phone] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] [Display(Name = "PhoneNumber")] - public string PhoneNumber { get; set; } + public string PhoneNumber { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneResetPasswordCodeDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneResetPasswordCodeDto.cs index 837a351f2..7e64d8dbb 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneResetPasswordCodeDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneResetPasswordCodeDto.cs @@ -10,5 +10,5 @@ public class SendPhoneResetPasswordCodeDto [Phone] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] [Display(Name = "PhoneNumber")] - public string PhoneNumber { get; set; } + public string PhoneNumber { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneSigninCodeDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneSigninCodeDto.cs index 81ed4e8b1..6e0e04572 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneSigninCodeDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneSigninCodeDto.cs @@ -10,5 +10,5 @@ public class SendPhoneSigninCodeDto [Phone] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] [Display(Name = "PhoneNumber")] - public string PhoneNumber { get; set; } + public string PhoneNumber { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/UserLoginInfoDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/UserLoginInfoDto.cs index f9d674356..93e838726 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/UserLoginInfoDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/UserLoginInfoDto.cs @@ -1,7 +1,7 @@ namespace LINGYUN.Abp.Account; public class UserLoginInfoDto { - public string LoginProvider { get; set; } - public string ProviderKey { get; set; } - public string ProviderDisplayName { get; set; } + public string LoginProvider { get; set; } = default!; + public string ProviderKey { get; set; } = default!; + public string? ProviderDisplayName { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyAuthenticatorCodeInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyAuthenticatorCodeInput.cs index 1bf81f182..bbde1d5bc 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyAuthenticatorCodeInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyAuthenticatorCodeInput.cs @@ -5,5 +5,5 @@ public class VerifyAuthenticatorCodeInput { [Required] [StringLength(6)] - public string AuthenticatorCode { get; set; } + public string AuthenticatorCode { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyLinkTokenInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyLinkTokenInput.cs index 512c16f03..444d103f6 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyLinkTokenInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyLinkTokenInput.cs @@ -10,5 +10,5 @@ public class VerifyLinkTokenInput : LinkUserBaseDto /// 关联用户Token /// [Required] - public string Token { get; set; } + public string Token { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyLinkUserDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyLinkUserDto.cs index 23642f5c9..e4a722838 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyLinkUserDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/VerifyLinkUserDto.cs @@ -11,7 +11,7 @@ public class VerifyLinkUserDto /// /// 关联用户名 /// - public string LinkUserName { get; set; } + public string? LinkUserName { get; set; } /// /// 关联租户Id /// @@ -19,7 +19,7 @@ public class VerifyLinkUserDto /// /// 关联租户名 /// - public string LinkTenantName { get; set; } + public string? LinkTenantName { get; set; } /// /// 是否已关联 /// diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/WeChatRegisterDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/WeChatRegisterDto.cs index f146c3cad..4f5a4f50d 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/WeChatRegisterDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/WeChatRegisterDto.cs @@ -10,20 +10,20 @@ public class WeChatRegisterDto [Required] [DisableAuditing] [Display(Name = "DisplayName:WeChatCode")] - public string Code { get; set; } + public string Code { get; set; } = default!; [DataType(DataType.Password)] - [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] [DisableAuditing] [Display(Name = "Password")] - public string Password { get; set; } + public string? Password { get; set; } [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] [Display(Name = "UserName")] - public string UserName { get; set; } + public string? UserName { get; set; } + [EmailAddress] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxEmailLength))] [Display(Name = "EmailAddress")] - public string EmailAddress { get; set; } + public string? EmailAddress { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyClaimAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyClaimAppService.cs index d4efa8a6d..944c5f00b 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyClaimAppService.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyClaimAppService.cs @@ -1,18 +1,10 @@ -using System; -using System.Threading.Tasks; +using System.Threading.Tasks; using Volo.Abp.Application.Services; namespace LINGYUN.Abp.Account; public interface IMyClaimAppService : IApplicationService { - /// - /// 变更头像 - /// - /// - /// - [Obsolete("请使用 IMyProfileAppService.ChangePictureAsync")] - Task ChangeAvatarAsync(ChangeAvatarInput input); /// /// 查询绑定状态 /// diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/en.json b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/en.json index 7f06b61ac..b98ca1eb9 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/en.json +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/en.json @@ -10,6 +10,7 @@ "InvalidVerifyCode": "The verification code is invalid or expired!", "RequiredEmailAddress": "Email address required", "InvalidPhoneNumber": "Invalid phone number", + "InvalidWeChatCode": "The WeChat verification code is invalid or has expired!", "DuplicateWeChat": "The wechat has been registered!", "DisplayName:SmsVerifyCode": "SMS verification code", "DisplayName:EmailVerifyCode": "Mail verification code", diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json index 791208eb4..f8b697f97 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json @@ -10,6 +10,7 @@ "InvalidVerifyCode": "验证码无效或已经过期!", "RequiredEmailAddress": "邮件地址必须输入", "InvalidPhoneNumber": "手机号无效", + "InvalidWeChatCode": "微信验证码无效或已过期!", "DuplicateWeChat": "微信号已经注册过!", "DisplayName:SmsVerifyCode": "短信验证码", "DisplayName:EmailVerifyCode": "邮件验证码", diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs index ca4624aff..3c5ca431e 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs @@ -56,7 +56,8 @@ public class AccountAppService : AccountApplicationServiceBase, IAccountAppServi var options = await MiniProgramOptionsFactory.CreateAsync(); - var wehchatOpenId = await WeChatOpenIdFinder.FindAsync(input.Code, options.AppId, options.AppSecret); + var wehchatOpenId = await WeChatOpenIdFinder.FindAsync(input.Code, options.AppId, options.AppSecret) + ?? throw new UserFriendlyException(L["InvalidWeChatCode"]); var user = await UserManager.FindByLoginAsync(AbpWeChatMiniProgramConsts.ProviderName, wehchatOpenId.OpenId); if (user != null) @@ -77,7 +78,11 @@ public class AccountAppService : AccountApplicationServiceBase, IAccountAppServi } user = new IdentityUser(GuidGenerator.Create(), userName, userEmail, CurrentTenant.Id); - (await UserManager.CreateAsync(user, input.Password)).CheckErrors(); + (await UserManager.CreateAsync(user)).CheckErrors(); + if (!input.Password.IsNullOrWhiteSpace()) + { + (await UserManager.AddPasswordAsync(user, input.Password)).CheckErrors(); + } (await UserManager.AddDefaultRolesAsync(user)).CheckErrors(); @@ -92,8 +97,6 @@ public class AccountAppService : AccountApplicationServiceBase, IAccountAppServi Identity = "Account", UserName = user.UserName }); - - await CurrentUnitOfWork.SaveChangesAsync(); } public async virtual Task SendPhoneRegisterCodeAsync(SendPhoneRegisterCodeDto input) @@ -131,7 +134,7 @@ public class AccountAppService : AccountApplicationServiceBase, IAccountAppServi securityTokenCacheItem = new SecurityTokenCacheItem(code, tempNewUser.Id, await UserManager.GetSecurityStampAsync(tempNewUser)); await SecurityCodeSender.SendAsync( - input.PhoneNumber, securityTokenCacheItem.Token, template); + input.PhoneNumber, securityTokenCacheItem.Token, template!); await SecurityTokenCache .SetAsync(securityTokenCacheKey, securityTokenCacheItem, @@ -145,6 +148,7 @@ public class AccountAppService : AccountApplicationServiceBase, IAccountAppServi { await CheckSelfRegistrationAsync(); await IdentityOptions.SetAsync(); + ThowIfInvalidEmailAddress(input.EmailAddress); await CheckNewUserPhoneNumberNotBeUsedAsync(input.PhoneNumber); var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey( @@ -203,8 +207,6 @@ public class AccountAppService : AccountApplicationServiceBase, IAccountAppServi UserName = user.UserName }); - await CurrentUnitOfWork.SaveChangesAsync(); - return; } } @@ -240,7 +242,7 @@ public class AccountAppService : AccountApplicationServiceBase, IAccountAppServi TokenOptions.DefaultPhoneProvider, UserTwoFactorTokenProviderConsts.PhoneResetPasswordPurpose); // 发送短信验证码 - await SecurityCodeSender.SendAsync(input.PhoneNumber, code, template); + await SecurityCodeSender.SendAsync(input.PhoneNumber, code, template!); // 缓存这个手机号的记录,防重复 securityTokenCacheItem = new SecurityTokenCacheItem(code, user.Id, user.SecurityStamp); await SecurityTokenCache @@ -295,8 +297,6 @@ public class AccountAppService : AccountApplicationServiceBase, IAccountAppServi Identity = "Account", UserName = user.UserName }); - - await CurrentUnitOfWork.SaveChangesAsync(); } public async virtual Task SendPhoneSigninCodeAsync(SendPhoneSigninCodeDto input) @@ -315,7 +315,7 @@ public class AccountAppService : AccountApplicationServiceBase, IAccountAppServi var template = await SettingProvider.GetOrNullAsync(IdentitySettingNames.User.SmsUserSignin); // 发送登录验证码短信 - await SecurityCodeSender.SendAsync(input.PhoneNumber, code, template); + await SecurityCodeSender.SendAsync(input.PhoneNumber, code, template!); // 缓存登录验证码状态,防止同一手机号重复发送 securityTokenCacheItem = new SecurityTokenCacheItem(code, user.Id, user.SecurityStamp); await SecurityTokenCache @@ -386,14 +386,14 @@ public class AccountAppService : AccountApplicationServiceBase, IAccountAppServi } } - protected virtual Task FindClientIdAsync() + protected virtual Task FindClientIdAsync() { var client = LazyServiceProvider.LazyGetRequiredService(); return Task.FromResult(client.Id); } - private void ThowIfInvalidEmailAddress(string inputEmail) + private void ThowIfInvalidEmailAddress(string? inputEmail) { if (!inputEmail.IsNullOrWhiteSpace() && !ValidationHelper.IsValidEmailAddress(inputEmail)) diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/IdentityLinkUserAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/IdentityLinkUserAppService.cs index 34bc88cad..805ff3d5d 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/IdentityLinkUserAppService.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/IdentityLinkUserAppService.cs @@ -130,7 +130,7 @@ public class IdentityLinkUserAppService : AccountApplicationServiceBase, IIdenti { using (CurrentTenant.Change(input.TenantId)) { - TenantConfiguration tenant = null; + TenantConfiguration? tenant = null; if (input.TenantId.HasValue) { tenant = await TenantStore.FindAsync(input.TenantId.Value); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyClaimAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyClaimAppService.cs index 21791db40..85ef6bab0 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyClaimAppService.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyClaimAppService.cs @@ -1,66 +1,13 @@ -using LINGYUN.Abp.Identity; -using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; -using System; -using System.Collections.Generic; using System.Linq; -using System.Security.Claims; using System.Threading.Tasks; -using Volo.Abp.Security.Claims; namespace LINGYUN.Abp.Account; [Authorize] public class MyClaimAppService : AccountApplicationServiceBase, IMyClaimAppService { - public MyClaimAppService() - { - - } - - public async virtual Task ChangeAvatarAsync(ChangeAvatarInput input) - { - var user = await GetCurrentUserAsync(); - - // TODO: Use AbpClaimTypes.Picture - user.Claims.RemoveAll(x => x.ClaimType.Equals(IdentityConsts.ClaimType.Avatar.Name)); - user.AddClaim(GuidGenerator, new Claim(IdentityConsts.ClaimType.Avatar.Name, input.AvatarUrl)); - - var avatarClaims = user.Claims.Where(x => x.ClaimType.StartsWith(AbpClaimTypes.Picture)) - .Select(x => x.ToClaim()) - .Skip(0) - .Take(3) - .ToList(); - if (avatarClaims.Any()) - { - // 保留最多3个头像 - if (avatarClaims.Count >= 3) - { - user.RemoveClaim(avatarClaims.First()); - avatarClaims.RemoveAt(0); - } - - // 历史头像加数字标识 - for (var index = 1; index <= avatarClaims.Count; index++) - { - var avatarClaim = avatarClaims[index - 1]; - var findClaim = user.FindClaim(avatarClaim); - if (findClaim != null) - { - findClaim.SetClaim(new Claim( - AbpClaimTypes.Picture + index.ToString(), - findClaim.ClaimValue)); - } - } - } - - user.AddClaim(GuidGenerator, new Claim(AbpClaimTypes.Picture, input.AvatarUrl)); - - (await UserManager.UpdateAsync(user)).CheckErrors(); - - await CurrentUnitOfWork.SaveChangesAsync(); - } - public async virtual Task GetStateAsync(string claimType) { var user = await GetCurrentUserAsync(); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyProfileAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyProfileAppService.cs index c0008d913..b9e248dad 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyProfileAppService.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyProfileAppService.cs @@ -57,7 +57,7 @@ public class MyProfileAppService : AccountApplicationServiceBase, IMyProfileAppS await UserPictureProvider.SetPictureAsync(user, input.File.GetStream(), pictureId); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetPictureAsync() @@ -130,7 +130,7 @@ public class MyProfileAppService : AccountApplicationServiceBase, IMyProfileAppS (await UserManager.SetTwoFactorEnabledWithAccountConfirmedAsync(user, input.Enabled)).CheckErrors(); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeInput input) @@ -153,7 +153,7 @@ public class MyProfileAppService : AccountApplicationServiceBase, IMyProfileAppS var template = await SettingProvider.GetOrNullAsync(Identity.Settings.IdentitySettingNames.User.SmsPhoneNumberConfirmed); var token = await UserManager.GenerateChangePhoneNumberTokenAsync(user, input.NewPhoneNumber); // 发送验证码 - await SmsSecurityCodeSender.SendAsync(input.NewPhoneNumber, token, template); + await SmsSecurityCodeSender.SendAsync(input.NewPhoneNumber, token, template!); securityTokenCacheItem = new SecurityTokenCacheItem(token, user.Id, user.ConcurrencyStamp); await SecurityTokenCache @@ -175,7 +175,7 @@ public class MyProfileAppService : AccountApplicationServiceBase, IMyProfileAppS // 更换手机号 (await UserManager.ChangePhoneNumberAsync(user, input.NewPhoneNumber, input.Code)).CheckErrors(); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.NewPhoneNumber, "SmsChangePhoneNumber"); await SecurityTokenCache.RemoveAsync(securityTokenCacheKey); @@ -248,7 +248,7 @@ public class MyProfileAppService : AccountApplicationServiceBase, IMyProfileAppS unformattedKey = await UserManager.GetAuthenticatorKeyAsync(user); } - var authenticatorUri = AuthenticatorUriGenerator.Generate(userEmail, unformattedKey); + var authenticatorUri = AuthenticatorUriGenerator.Generate(userEmail!, unformattedKey!); return new AuthenticatorDto { @@ -278,11 +278,11 @@ public class MyProfileAppService : AccountApplicationServiceBase, IMyProfileAppS (await UserManager.UpdateAsync(user)).CheckErrors(); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return new AuthenticatorRecoveryCodeDto { - RecoveryCodes = recoveryCodes.ToList(), + RecoveryCodes = recoveryCodes?.ToList(), }; } @@ -308,11 +308,15 @@ public class MyProfileAppService : AccountApplicationServiceBase, IMyProfileAppS (await UserManager.UpdateAsync(user)).CheckErrors(); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } - private static string FormatKey(string unformattedKey) + private static string? FormatKey(string? unformattedKey) { + if (unformattedKey.IsNullOrWhiteSpace()) + { + return null; + } var result = new StringBuilder(); var currentPosition = 0; while (currentPosition + 4 < unformattedKey.Length) diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/UserProfilePictureProvider.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/UserProfilePictureProvider.cs index 0caa2490b..15c7a035d 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/UserProfilePictureProvider.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/UserProfilePictureProvider.cs @@ -31,7 +31,7 @@ public class UserProfileUserPictureProvider : IUserPictureProvider AccountBlobContainer = accountBlobContainer; } - public async virtual Task SetPictureAsync(IdentityUser user, Stream stream, string fileName = null) + public async virtual Task SetPictureAsync(IdentityUser user, Stream stream, string? fileName = null) { var userId = user.Id.ToString("N"); var pictureBlobId = fileName ?? $"{GuidGenerator.Create():n}.jpg"; diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi.Client/ClientProxies/LINGYUN/Abp/Account/MyClaimClientProxy.Generated.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi.Client/ClientProxies/LINGYUN/Abp/Account/MyClaimClientProxy.Generated.cs index 06170f499..5b8a741fe 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi.Client/ClientProxies/LINGYUN/Abp/Account/MyClaimClientProxy.Generated.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi.Client/ClientProxies/LINGYUN/Abp/Account/MyClaimClientProxy.Generated.cs @@ -17,14 +17,6 @@ namespace LINGYUN.Abp.Account; [ExposeServices(typeof(IMyClaimAppService), typeof(MyClaimClientProxy))] public partial class MyClaimClientProxy : ClientProxyBase, IMyClaimAppService { - public virtual async Task ChangeAvatarAsync(ChangeAvatarInput input) - { - await RequestAsync(nameof(ChangeAvatarAsync), new ClientProxyRequestTypeValue - { - { typeof(ChangeAvatarInput), input } - }); - } - public virtual async Task GetStateAsync(string claimType) { return await RequestAsync(nameof(GetStateAsync), new ClientProxyRequestTypeValue diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyClaimController.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyClaimController.cs index 50dd726bb..b5ab829f3 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyClaimController.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyClaimController.cs @@ -1,7 +1,6 @@ using Asp.Versioning; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using System; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Account; @@ -24,14 +23,6 @@ public class MyClaimController : AbpControllerBase, IMyClaimAppService _service = service; } - [HttpPost] - [Route("change-avatar")] - [Obsolete("请使用 IMyProfileAppService.ChangePictureAsync")] - public virtual Task ChangeAvatarAsync(ChangeAvatarInput input) - { - return _service.ChangeAvatarAsync(input); - } - [HttpGet] [Route("state/{claimType}")] public virtual Task GetStateAsync(string claimType) diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Security/LINGYUN/Abp/Account/Security/AccountEmailSecurityCodeSender.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Security/LINGYUN/Abp/Account/Security/AccountEmailSecurityCodeSender.cs index 64e16fb20..256257440 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Security/LINGYUN/Abp/Account/Security/AccountEmailSecurityCodeSender.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Security/LINGYUN/Abp/Account/Security/AccountEmailSecurityCodeSender.cs @@ -65,8 +65,8 @@ public class AccountEmailSecurityCodeSender : string userEmail, string confirmToken, string appName, - string returnUrl = null, - string returnUrlHash = null, + string? returnUrl = null, + string? returnUrlHash = null, Guid? userTenantId = null) { Debug.Assert(CurrentTenant.Id == userTenantId, "This method can only work for current tenant!"); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Security/LINGYUN/Abp/Account/Security/IAccountEmailSecurityCodeSender.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Security/LINGYUN/Abp/Account/Security/IAccountEmailSecurityCodeSender.cs index c2f1f7d9b..e3cf90039 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Security/LINGYUN/Abp/Account/Security/IAccountEmailSecurityCodeSender.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Security/LINGYUN/Abp/Account/Security/IAccountEmailSecurityCodeSender.cs @@ -34,8 +34,8 @@ public interface IAccountEmailSecurityCodeSender string userEmail, string confirmToken, string appName, - string returnUrl = null, - string returnUrlHash = null, + string? returnUrl = null, + string? returnUrlHash = null, Guid? userTenantId = null ); } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerLoginModel.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerLoginModel.cs index 7beb47dde..fe4528428 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerLoginModel.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerLoginModel.cs @@ -351,12 +351,12 @@ namespace LINGYUN.Abp.Account.Web.IdentityServer.Pages.Account }; var id = new ClaimsIdentity(AccountOptions.WindowsAuthenticationSchemeName); - id.AddClaim(new Claim(ClaimTypes.NameIdentifier, result.Principal.FindFirstValue(ClaimTypes.PrimarySid))); - id.AddClaim(new Claim(ClaimTypes.Name, result.Principal.FindFirstValue(ClaimTypes.Name))); + id.AddClaim(new Claim(ClaimTypes.NameIdentifier, result.Principal.FindFirstValue(ClaimTypes.PrimarySid)!)); + id.AddClaim(new Claim(ClaimTypes.Name, result.Principal.FindFirstValue(ClaimTypes.Name)!)); await HttpContext.SignInAsync(IdentityConstants.ExternalScheme, new ClaimsPrincipal(id), props); - return Redirect(props.RedirectUri); + return Redirect(props.RedirectUri!); } return Challenge(AccountOptions.WindowsAuthenticationSchemeName); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OAuth/Areas/Account/Controllers/Dtos/WorkWeixinLoginBindInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OAuth/Areas/Account/Controllers/Dtos/WorkWeixinLoginBindInput.cs index 9663c3161..ebdb3841e 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OAuth/Areas/Account/Controllers/Dtos/WorkWeixinLoginBindInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OAuth/Areas/Account/Controllers/Dtos/WorkWeixinLoginBindInput.cs @@ -6,5 +6,5 @@ public class WorkWeixinLoginBindInput { [Required] [Display(Name = "WorkWeixin:Code")] - public string Code { get; set; } + public string Code { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/AbpAccountWebOpenIddictModule.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/AbpAccountWebOpenIddictModule.cs index 66b4779f2..d175fa15c 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/AbpAccountWebOpenIddictModule.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/AbpAccountWebOpenIddictModule.cs @@ -58,12 +58,12 @@ public class AbpAccountWebOpenIddictModule : AbpModule Configure(options => { options.ScriptBundles - .Add(typeof(SelectAccountModel).FullName, bundle => + .Add(typeof(SelectAccountModel).FullName!, bundle => { bundle.AddFiles("/Pages/Account/SelectAccount.js"); }); options.StyleBundles - .Add(typeof(SelectAccountModel).FullName, bundle => + .Add(typeof(SelectAccountModel).FullName!, bundle => { bundle.AddFiles("/css/select-account.css"); }); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Controllers/AuthorizeController.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Controllers/AuthorizeController.cs index d18dfbe92..d97be5a5e 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Controllers/AuthorizeController.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Controllers/AuthorizeController.cs @@ -77,7 +77,7 @@ public class AuthorizeController : Volo.Abp.OpenIddict.Controllers.AuthorizeCont { return Forbid( authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, - properties: new AuthenticationProperties(new Dictionary + properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.LoginRequired, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The user is not logged in." @@ -141,7 +141,7 @@ public class AuthorizeController : Volo.Abp.OpenIddict.Controllers.AuthorizeCont } // Retrieve the application details from the database. - var application = await ApplicationManager.FindByClientIdAsync(request.ClientId) ?? + var application = await ApplicationManager.FindByClientIdAsync(request.ClientId!) ?? throw new InvalidOperationException(L["DetailsConcerningTheCallingClientApplicationCannotBeFound"]); // Retrieve the permanent authorizations associated with the user and the calling client application. @@ -159,7 +159,7 @@ public class AuthorizeController : Volo.Abp.OpenIddict.Controllers.AuthorizeCont case OpenIddictConstants.ConsentTypes.External when !authorizations.Any(): return Forbid( authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, - properties: new AuthenticationProperties(new Dictionary + properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.ConsentRequired, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The logged in user is not allowed to access this client application." @@ -199,7 +199,7 @@ public class AuthorizeController : Volo.Abp.OpenIddict.Controllers.AuthorizeCont authorization = await AuthorizationManager.CreateAsync( principal: principal, subject: await UserManager.GetUserIdAsync(user), - client: await ApplicationManager.GetIdAsync(application), + client: (await ApplicationManager.GetIdAsync(application))!, type: OpenIddictConstants.AuthorizationTypes.Permanent, scopes: principal.GetScopes()); } @@ -216,7 +216,7 @@ public class AuthorizeController : Volo.Abp.OpenIddict.Controllers.AuthorizeCont case OpenIddictConstants.ConsentTypes.Systematic when request.HasPromptValue(OpenIddictConstants.PromptValues.None): return Forbid( authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, - properties: new AuthenticationProperties(new Dictionary + properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.ConsentRequired, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "Interactive user consent is required." @@ -252,7 +252,7 @@ public class AuthorizeController : Volo.Abp.OpenIddict.Controllers.AuthorizeCont throw new InvalidOperationException(L["TheUserDetailsCannotBbeRetrieved"]); // Retrieve the application details from the database. - var application = await ApplicationManager.FindByClientIdAsync(request.ClientId) ?? + var application = await ApplicationManager.FindByClientIdAsync(request.ClientId!) ?? throw new InvalidOperationException(L["DetailsConcerningTheCallingClientApplicationCannotBeFound"]); // Retrieve the permanent authorizations associated with the user and the calling client application. @@ -270,7 +270,7 @@ public class AuthorizeController : Volo.Abp.OpenIddict.Controllers.AuthorizeCont { return Forbid( authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, - properties: new AuthenticationProperties(new Dictionary + properties: new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.ConsentRequired, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The logged in user is not allowed to access this client application." @@ -311,7 +311,7 @@ public class AuthorizeController : Volo.Abp.OpenIddict.Controllers.AuthorizeCont authorization = await AuthorizationManager.CreateAsync( principal: principal, subject: await UserManager.GetUserIdAsync(user), - client: await ApplicationManager.GetIdAsync(application), + client: (await ApplicationManager.GetIdAsync(application))!, type: OpenIddictConstants.AuthorizationTypes.Permanent, scopes: principal.GetScopes()); } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/Account/OpenIddictLoginModel.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/Account/OpenIddictLoginModel.cs index 337a48f9c..a46463331 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/Account/OpenIddictLoginModel.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/Account/OpenIddictLoginModel.cs @@ -47,7 +47,7 @@ namespace LINGYUN.Abp.Account.Web.OpenIddict.Pages.Account // TODO: Find a proper cancel way. // ShowCancelButton = true; - PasswordLoginInput.UserNameOrEmailAddress = request.LoginHint; + PasswordLoginInput.UserNameOrEmailAddress = request.LoginHint!; //TODO: Reference AspNetCore MultiTenancy module and use options to get the tenant key! var tenant = request.GetParameter(TenantResolverConsts.DefaultTenantKey)?.ToString(); @@ -137,8 +137,8 @@ namespace LINGYUN.Abp.Account.Web.OpenIddict.Pages.Account }; var id = new ClaimsIdentity(AccountOptions.WindowsAuthenticationSchemeName); - id.AddClaim(new Claim(ClaimTypes.NameIdentifier, result.Principal.FindFirstValue(ClaimTypes.PrimarySid))); - id.AddClaim(new Claim(ClaimTypes.Name, result.Principal.FindFirstValue(ClaimTypes.Name))); + id.AddClaim(new Claim(ClaimTypes.NameIdentifier, result.Principal.FindFirstValue(ClaimTypes.PrimarySid)!)); + id.AddClaim(new Claim(ClaimTypes.Name, result.Principal.FindFirstValue(ClaimTypes.Name)!)); await HttpContext.SignInAsync(IdentityConstants.ExternalScheme, new ClaimsPrincipal(id), props); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/Account/SelectAccount.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/Account/SelectAccount.cshtml.cs index 7340a7219..61530ed60 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/Account/SelectAccount.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/Pages/Account/SelectAccount.cshtml.cs @@ -25,17 +25,17 @@ public class SelectAccountModel : AccountPageModel private const string LastLoginTimeFieldName = "LastLoginTime"; private const string AllowedTenantsFieldName = "AllowedTenants"; public const string DefaultDateFormat = "yyyy-MM-dd HH:mm:ss"; - private OriginalRequestInfo _originalRequest; + private OriginalRequestInfo? _originalRequest; [BindProperty(SupportsGet = true)] - public string RedirectUri { get; set; } + public string RedirectUri { get; set; } = default!; - public string ClientName { get; set; } + public string ClientName { get; set; } = default!; - public string UserName { get; set; } + public string UserName { get; set; } = default!; [BindProperty] - public SelectAccountInput Input { get; set; } + public SelectAccountInput Input { get; set; } = default!; public List AvailableAccounts { get; set; } = new(); @@ -53,7 +53,7 @@ public class SelectAccountModel : AccountPageModel public async virtual Task OnGetAsync() { // ûǷѵ¼ - if (!User.Identity.IsAuthenticated) + if (User.Identity?.IsAuthenticated == false) { // δ¼ض򵽵¼ҳ return RedirectToPage("/Account/Login", new @@ -77,7 +77,7 @@ public class SelectAccountModel : AccountPageModel }; var application = await ApplicationManager.FindByClientIdAsync(_originalRequest.ClientId); - ClientName = await ApplicationManager.GetLocalizedDisplayNameAsync(application) ?? _originalRequest.ClientId; + ClientName = await ApplicationManager.GetLocalizedDisplayNameAsync(application!) ?? _originalRequest.ClientId; var currentUser = await UserManager.GetUserAsync(User); if (currentUser == null) @@ -198,7 +198,7 @@ public class SelectAccountModel : AccountPageModel } // Ȩ URL var authorizeUrl = "/connect/authorize"; - var parameters = new Dictionary + var parameters = new Dictionary { ["client_id"] = _originalRequest.ClientId, ["redirect_uri"] = _originalRequest.RedirectUri, @@ -219,17 +219,17 @@ public class SelectAccountModel : AccountPageModel return QueryHelpers.AddQueryString(authorizeUrl, parameters); } - protected virtual Task ParseOriginalRequestFromRedirectUriAsync() + protected virtual Task ParseOriginalRequestFromRedirectUriAsync() { if (string.IsNullOrWhiteSpace(RedirectUri)) { - return Task.FromResult(null); + return Task.FromResult(null); } try { var info = new OriginalRequestInfo(); - string queryString = null; + string? queryString = null; if (RedirectUri.StartsWith("/")) { @@ -270,8 +270,8 @@ public class SelectAccountModel : AccountPageModel { var query = QueryHelpers.ParseQuery(queryString); - info.ClientId = GetQueryValue(query, "client_id"); - info.RedirectUri = GetQueryValue(query, "redirect_uri"); + info.ClientId = GetQueryValue(query, "client_id")!; + info.RedirectUri = GetQueryValue(query, "redirect_uri")!; info.ResponseType = GetQueryValue(query, "response_type"); info.Scope = GetQueryValue(query, "scope"); info.State = GetQueryValue(query, "state"); @@ -281,12 +281,12 @@ public class SelectAccountModel : AccountPageModel info.Prompt = GetQueryValue(query, "prompt"); } - return Task.FromResult(info); + return Task.FromResult(info); } catch (Exception ex) { Logger.LogWarning(ex, "Parse the error of the RedirectUri parameter: {message}", ex.Message); - return Task.FromResult(null); + return Task.FromResult(null); } } @@ -327,7 +327,7 @@ public class SelectAccountModel : AccountPageModel .ToList(); } - protected async virtual Task GetTenantUserAccountInfoAsync(string userName, TenantInfo tenant) + protected async virtual Task GetTenantUserAccountInfoAsync(string userName, TenantInfo tenant) { using (CurrentTenant.Change(tenant.Id, tenant.Name)) { @@ -421,12 +421,12 @@ public class SelectAccountModel : AccountPageModel return new TenantUser(); } - protected virtual string GetQueryValue(Dictionary query, string key) + protected virtual string? GetQueryValue(Dictionary query, string key) { return query.TryGetValue(key, out var value) ? value.ToString() : null; } - protected async virtual Task ValidateSelectedAccountAsync(Guid userId, Guid? tenantId) + protected async virtual Task ValidateSelectedAccountAsync(Guid userId, Guid? tenantId) { using (CurrentTenant.Change(tenantId)) { @@ -458,27 +458,27 @@ public class SelectAccountModel : AccountPageModel public class OriginalRequestInfo { - public string ClientId { get; set; } - public string RedirectUri { get; set; } - public string Scope { get; set; } - public string State { get; set; } - public string Nonce { get; set; } - public string ResponseType { get; set; } - public string CodeChallenge { get; set; } - public string CodeChallengeMethod { get; set; } - public string Prompt { get; set; } + public string ClientId { get; set; } = default!; + public string RedirectUri { get; set; } = default!; + public string? Scope { get; set; } + public string? State { get; set; } + public string? Nonce { get; set; } + public string? ResponseType { get; set; } + public string? CodeChallenge { get; set; } + public string? CodeChallengeMethod { get; set; } + public string? Prompt { get; set; } } public class SelectAccountInput { [Required] - public string SelectedAccountId { get; set; } + public string SelectedAccountId { get; set; } = default!; [Required] - public string ClientId { get; set; } + public string ClientId { get; set; } = default!; [Required] - public string RedirectUri { get; set; } + public string RedirectUri { get; set; } = default!; public bool RememberSelection { get; set; } = true; @@ -487,11 +487,11 @@ public class SelectAccountModel : AccountPageModel public class UserAccountInfo { - public string UserId { get; set; } + public string UserId { get; set; } = default!; public Guid? TenantId { get; set; } - public string TenantName { get; set; } - public string UserName { get; set; } - public string Email { get; set; } + public string? TenantName { get; set; } + public string UserName { get; set; } = default!; + public string Email { get; set; } = default!; public DateTime? LastLoginTime { get; set; } public bool IsCurrentAccount { get; set; } } @@ -499,7 +499,7 @@ public class SelectAccountModel : AccountPageModel public class TenantInfo { public Guid Id { get; set; } - public string Name { get; set; } + public string Name { get; set; } = default!; } public class TenantUser diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/ViewModels/Authorize/AuthorizeViewModel.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/ViewModels/Authorize/AuthorizeViewModel.cs index 351f746b8..af88869b0 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/ViewModels/Authorize/AuthorizeViewModel.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web.OpenIddict/ViewModels/Authorize/AuthorizeViewModel.cs @@ -5,19 +5,19 @@ namespace LINGYUN.Abp.Account.Web.OpenIddict.ViewModels.Authorize; public class AuthorizeViewModel { - public string ApplicationName { get; set; } + public string? ApplicationName { get; set; } [HiddenInput] - public string Scope { get; set; } + public string? Scope { get; set; } - public List AvailableScopes { get; set; } + public List? AvailableScopes { get; set; } } public class ScopeItemViewModel { - public string Value { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } + public string Value { get; set; } = default!; + public string? DisplayName { get; set; } + public string? Description { get; set; } public bool IsRequired { get; set; } public bool IsChecked { get; set; } } \ No newline at end of file diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/AbpAccountWebModule.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/AbpAccountWebModule.cs index 246d577c8..a52d0d535 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/AbpAccountWebModule.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/AbpAccountWebModule.cs @@ -83,7 +83,7 @@ public class AbpAccountWebModule : AbpModule }); options.ScriptBundles - .Configure(typeof(ManageModel).FullName, + .Configure(typeof(ManageModel).FullName!, bundle => { // Client Proxies @@ -110,7 +110,7 @@ public class AbpAccountWebModule : AbpModule bundle.AddContributors(typeof(ChangePasswordScriptContributor)); }); options.ScriptBundles - .Configure(typeof(Pages.Account.LoginModel).FullName, bundle => + .Configure(typeof(Pages.Account.LoginModel).FullName!, bundle => { bundle.AddFiles("/client-proxies/account-proxy.js"); bundle.AddFiles("/client-proxies/qrcode-proxy.js"); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs index a53e5e7c1..938c382c1 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/AccountController.cs @@ -92,7 +92,7 @@ public class AccountController : AbpController if (string.IsNullOrWhiteSpace(provider) || string.IsNullOrWhiteSpace(returnUrl)) { Logger.LogWarning("The parameter is incorrect"); - return Redirect(QueryHelpers.AddQueryString(returnUrl, new Dictionary() + return Redirect(QueryHelpers.AddQueryString(returnUrl, new Dictionary() { ["error"] = "The parameter is incorrect" })); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/GenerateQrCodeResult.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/GenerateQrCodeResult.cs index 2accfbb27..eec215869 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/GenerateQrCodeResult.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/GenerateQrCodeResult.cs @@ -2,5 +2,5 @@ public class GenerateQrCodeResult { - public string Key { get; set; } + public string Key { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/QrCodeInfoResult.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/QrCodeInfoResult.cs index 8f8a2e695..92a4e2863 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/QrCodeInfoResult.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/QrCodeInfoResult.cs @@ -4,6 +4,6 @@ namespace LINGYUN.Abp.Account.Web.Areas.Account.Controllers.Models; public class QrCodeInfoResult { - public string Key { get; set; } + public string Key { get; set; } = default!; public QrCodeStatus Status { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/QrCodeUserInfoResult.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/QrCodeUserInfoResult.cs index 48e0678ad..31559675a 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/QrCodeUserInfoResult.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Areas/Account/Controllers/Models/QrCodeUserInfoResult.cs @@ -5,7 +5,7 @@ namespace LINGYUN.Abp.Account.Web.Areas.Account.Controllers.Models; public class QrCodeUserInfoResult : QrCodeInfoResult { public Guid? TenantId { get; set; } - public string UserId { get; set; } - public string UserName { get; set; } - public string Picture { get; set; } + public string? UserId { get; set; } + public string? UserName { get; set; } + public string? Picture { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Microsoft/AspNetCore/Mvc/ModelBinding/ModelStateExtensions.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Microsoft/AspNetCore/Mvc/ModelBinding/ModelStateExtensions.cs index 4f72500b8..72c6d7647 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Microsoft/AspNetCore/Mvc/ModelBinding/ModelStateExtensions.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Microsoft/AspNetCore/Mvc/ModelBinding/ModelStateExtensions.cs @@ -22,6 +22,6 @@ public static class ModelStateExtensions return modelState.Keys .Where(k => k.StartsWith(modelName + ".") || k == modelName) - .All(key => modelState[key].ValidationState == ModelValidationState.Valid); + .All(key => modelState[key]?.ValidationState == ModelValidationState.Valid); } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Models/ExternalLoginProviderModel.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Models/ExternalLoginProviderModel.cs index 506398975..beec2cd19 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Models/ExternalLoginProviderModel.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Models/ExternalLoginProviderModel.cs @@ -4,8 +4,8 @@ namespace LINGYUN.Abp.Account.Web.Models; public class ExternalLoginProviderModel { - public Type ComponentType { get; set; } - public string Name { get; set; } - public string DisplayName { get; set; } - public string AuthenticationScheme { get; set; } + public Type ComponentType { get; set; } = default!; + public string Name { get; set; } = default!; + public string DisplayName { get; set; } = default!; + public string AuthenticationScheme { get; set; } = default!; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/ChangePassword.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/ChangePassword.cshtml.cs index 730624c8d..5cf33d6c7 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/ChangePassword.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/ChangePassword.cshtml.cs @@ -29,38 +29,38 @@ public class ChangePasswordInputModel [Display(Name = "DisplayName:CurrentPassword")] [DataType(DataType.Password)] [DisableAuditing] - public string CurrentPassword { get; set; } + public string CurrentPassword { get; set; } = default!; [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] [Display(Name = "DisplayName:NewPassword")] [DataType(DataType.Password)] [DisableAuditing] - public string NewPassword { get; set; } + public string NewPassword { get; set; } = default!; [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] [Display(Name = "DisplayName:NewPasswordConfirm")] [DataType(DataType.Password)] [DisableAuditing] - public string NewPasswordConfirm { get; set; } + public string NewPasswordConfirm { get; set; } = default!; } public class ChangePasswordModel : AccountPageModel { [BindProperty] - public UserInfoModel UserInfo { get; set; } + public UserInfoModel? UserInfo { get; set; } [BindProperty] - public ChangePasswordInputModel Input { get; set; } + public ChangePasswordInputModel Input { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } + public string ReturnUrl { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } + public string? ReturnUrlHash { get; set; } [BindProperty(SupportsGet = true)] public bool RememberMe { get; set; } @@ -150,7 +150,7 @@ public class ChangePasswordModel : AccountPageModel return RedirectToPage("/Login", new { ReturnUrl, ReturnUrlHash }); } - protected async virtual Task GetCurrentUser() + protected async virtual Task GetCurrentUser() { var result = await HttpContext.AuthenticateAsync(AbpAccountAuthenticationTypes.ShouldChangePassword); @@ -160,7 +160,7 @@ public class ChangePasswordModel : AccountPageModel return null; } - var tenantId = result.Principal.FindTenantId(); + var tenantId = result?.Principal?.FindTenantId(); using (CurrentTenant.Change(tenantId, null)) { var identityUser = await UserManager.FindByIdAsync(userId.Value.ToString()); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Authenticator/AccountProfileAuthenticatorManagementGroupViewComponent.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Authenticator/AccountProfileAuthenticatorManagementGroupViewComponent.cs index a4b8bddca..fd2286e0c 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Authenticator/AccountProfileAuthenticatorManagementGroupViewComponent.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Authenticator/AccountProfileAuthenticatorManagementGroupViewComponent.cs @@ -33,12 +33,12 @@ public class AccountProfileAuthenticatorManagementGroupViewComponent : AbpViewCo { public bool IsAuthenticated { get; set; } - public string SharedKey { get; set; } + public string? SharedKey { get; set; } - public string AuthenticatorUri { get; set; } + public string? AuthenticatorUri { get; set; } [Required] [StringLength(6)] - public string AuthenticatorCode { get; set; } + public string AuthenticatorCode { get; set; } = default!; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirm.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirm.cshtml.cs index 78324b1a0..d395c3c73 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirm.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirm.cshtml.cs @@ -20,17 +20,17 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account [Required] [HiddenInput] [BindProperty(SupportsGet = true)] - public string ConfirmToken { get; set; } + public string ConfirmToken { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } + public string ReturnUrl { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } + public string? ReturnUrlHash { get; set; } - public IMyProfileAppService MyProfileAppService { get; set; } + public IMyProfileAppService MyProfileAppService => LazyServiceProvider.LazyGetRequiredService(); public EmailConfirmModel() { diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirmConfirmation.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirmConfirmation.cshtml.cs index 334a7d8fe..83cf2e111 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirmConfirmation.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/EmailConfirmConfirmation.cshtml.cs @@ -9,10 +9,10 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account; public class EmailConfirmConfirmationModel : AccountPageModel { [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } + public string ReturnUrl { get; set; } = default!; [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } + public string? ReturnUrlHash { get; set; } public async virtual Task OnGetAsync() { diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/ExternalLoginBind.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/ExternalLoginBind.cshtml.cs index d574c7ec8..996664de5 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/ExternalLoginBind.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/ExternalLoginBind.cshtml.cs @@ -41,7 +41,7 @@ public class ExternalLoginBindModel : AbpPageModel if (string.IsNullOrWhiteSpace(provider) || string.IsNullOrWhiteSpace(returnUrl)) { Logger.LogWarning("The parameter is incorrect"); - return Redirect(QueryHelpers.AddQueryString(returnUrl, new Dictionary() + return Redirect(QueryHelpers.AddQueryString(returnUrl, new Dictionary() { ["error"] = "The parameter is incorrect" })); @@ -73,7 +73,7 @@ public class ExternalLoginBindModel : AbpPageModel if (string.IsNullOrWhiteSpace(returnUrl)) { Logger.LogWarning("The returnUrl cannot be empty"); - return Redirect(QueryHelpers.AddQueryString(returnUrl, new Dictionary() + return Redirect(QueryHelpers.AddQueryString(returnUrl, new Dictionary() { ["error"] = "The returnUrl cannot be empty" })); @@ -89,7 +89,7 @@ public class ExternalLoginBindModel : AbpPageModel if (loginInfo == null) { Logger.LogWarning("External login info is not available"); - return Redirect(QueryHelpers.AddQueryString(returnUrl, new Dictionary() + return Redirect(QueryHelpers.AddQueryString(returnUrl, new Dictionary() { ["error"] = "External login info is not available." })); @@ -100,7 +100,7 @@ public class ExternalLoginBindModel : AbpPageModel if (await UserManager.FindByLoginAsync(loginInfo.LoginProvider, loginInfo.ProviderKey) == null) { var externalUser = await UserManager.FindByIdAsync(userId); - CheckIdentityErrors(await UserManager.AddLoginAsync(externalUser, loginInfo)); + CheckIdentityErrors(await UserManager.AddLoginAsync(externalUser!, loginInfo)); } return Redirect(returnUrl); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/LinkLogged.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/LinkLogged.cshtml.cs index 47a5649ec..654d2c1fd 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/LinkLogged.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/LinkLogged.cshtml.cs @@ -14,10 +14,10 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account; public class LinkLoggedModel : AccountPageModel { [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } + public string ReturnUrl { get; set; } = default!; [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } + public string? ReturnUrlHash { get; set; } [HiddenInput] [BindProperty(SupportsGet = true)] @@ -27,7 +27,7 @@ public class LinkLoggedModel : AccountPageModel [BindProperty(SupportsGet = true)] public Guid? LinkTenantId { get; set; } - public string LinkTenantAndUserName { get; set; } + public string? LinkTenantAndUserName { get; set; } protected ICurrentPrincipalAccessor CurrentPrincipalAccessor => LazyServiceProvider.LazyGetRequiredService(); public IIdentityLinkUserAppService IdentityLinkUserAppService => LazyServiceProvider.LazyGetRequiredService(); diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Login.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Login.cshtml.cs index 8ab17a456..0f02e907b 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Login.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Login.cshtml.cs @@ -41,32 +41,32 @@ public class LoginModel : AccountPageModel { [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } + public string ReturnUrl { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } + public string? ReturnUrlHash { get; set; } [HiddenInput] [BindProperty(SupportsGet = true)] public LoginType LoginType { get; set; } [BindProperty(Name = "PasswordLoginInput")] - public PasswordLoginInputModel PasswordLoginInput { get; set; } + public PasswordLoginInputModel PasswordLoginInput { get; set; } = default!; [BindProperty(Name = "PhoneLoginInput")] - public PhoneLoginInputModel PhoneLoginInput { get; set; } + public PhoneLoginInputModel PhoneLoginInput { get; set; } = default!; [BindProperty(Name = "QrCodeLoginInput")] - public QrCodeLoginInputModel QrCodeLoginInput { get; set; } + public QrCodeLoginInputModel QrCodeLoginInput { get; set; } = default!; public bool EnableLocalLogin { get; set; } public bool ShowCancelButton { get; set; } public bool IsExternalLoginOnly => EnableLocalLogin == false && ExternalProviders?.Count() == 1; - public string ExternalLoginScheme => IsExternalLoginOnly ? ExternalProviders?.SingleOrDefault()?.AuthenticationScheme : null; + public string? ExternalLoginScheme => IsExternalLoginOnly ? ExternalProviders?.SingleOrDefault()?.AuthenticationScheme : null; - public IEnumerable ExternalProviders { get; set; } + public IEnumerable ExternalProviders { get; set; } = default!; public IEnumerable VisibleExternalProviders => ExternalProviders.Where(x => !x.DisplayName.IsNullOrWhiteSpace()); protected IIdentityUserRepository UserRepository => LazyServiceProvider.LazyGetRequiredService(); @@ -86,7 +86,7 @@ public class LoginModel : AccountPageModel [HiddenInput] [BindProperty(SupportsGet = true)] - public string LinkToken { get; set; } + public string? LinkToken { get; set; } public bool IsLinkLogin { get; set; } @@ -278,7 +278,7 @@ public class LoginModel : AccountPageModel { Response.Cookies.Append( "__tenant", - tenantId.ToString(), + tenantId.Value.ToString(), new CookieOptions { Path = "/", @@ -369,7 +369,7 @@ public class LoginModel : AccountPageModel return await Task.FromResult(Challenge(properties, provider)); } - public virtual async Task OnGetExternalLoginCallbackAsync(string returnUrl = "", string returnUrlHash = "", string remoteError = null) + public virtual async Task OnGetExternalLoginCallbackAsync(string returnUrl = "", string returnUrlHash = "", string? remoteError = null) { //TODO: Did not implemented Identity Server 4 sample for this method (see ExternalLoginCallback in Quickstart of IDS4 sample) /* Also did not implement these: @@ -421,7 +421,7 @@ public class LoginModel : AccountPageModel return await HandleExternalLoginNotAllowed(loginInfo); } - IdentityUser user; + IdentityUser? user; if (result.Succeeded) { user = await UserManager.FindByLoginAsync(loginInfo.LoginProvider, loginInfo.ProviderKey); @@ -499,7 +499,7 @@ public class LoginModel : AccountPageModel } - protected virtual async Task GetIdentityUserAsync(string userNameOrEmailAddress) + protected virtual async Task GetIdentityUserAsync(string userNameOrEmailAddress) { return await UserManager.FindByNameAsync(userNameOrEmailAddress) ?? await UserManager.FindByEmailAsync(userNameOrEmailAddress); @@ -518,7 +518,7 @@ public class LoginModel : AccountPageModel { externalProviderModels.Add(new ExternalLoginProviderModel { - Name = externalLoginProvider.Name, + Name = externalLoginProvider!.Name, AuthenticationScheme = scheme.Name, DisplayName = externalLoginProvider.DisplayName, ComponentType = externalLoginProvider.ComponentType, @@ -529,7 +529,7 @@ public class LoginModel : AccountPageModel return externalProviderModels; } - protected virtual bool TryGetExternalLoginProvider(AuthenticationScheme scheme, List externalProviders, out ExternalLoginProviderModel externalLoginProvider) + protected virtual bool TryGetExternalLoginProvider(AuthenticationScheme scheme, List externalProviders, out ExternalLoginProviderModel? externalLoginProvider) { if (ReflectionHelper.IsAssignableToGenericType(scheme.HandlerType, typeof(RemoteAuthenticationHandler<>))) { @@ -580,7 +580,7 @@ public class LoginModel : AccountPageModel protected async virtual Task HandleUserNotAllowed() { var notAllowedUser = await GetIdentityUserAsync(PasswordLoginInput.UserNameOrEmailAddress); - if (await UserManager.CheckPasswordAsync(notAllowedUser, PasswordLoginInput.Password)) + if (notAllowedUser != null && await UserManager.CheckPasswordAsync(notAllowedUser, PasswordLoginInput.Password)) { // û޸ if (notAllowedUser.ShouldChangePasswordOnNextLogin || await UserManager.ShouldPeriodicallyChangePasswordAsync(notAllowedUser)) @@ -630,7 +630,7 @@ public class LoginModel : AccountPageModel changePwdIdentity.AddClaim(new Claim(AbpClaimTypes.UserId, user.Id.ToString())); if (user.TenantId.HasValue) { - changePwdIdentity.AddClaim(new Claim(AbpClaimTypes.TenantId, user.TenantId.ToString())); + changePwdIdentity.AddClaim(new Claim(AbpClaimTypes.TenantId, user.TenantId.Value.ToString())); } await HttpContext.SignInAsync(AbpAccountAuthenticationTypes.ShouldChangePassword, new ClaimsPrincipal(changePwdIdentity)); @@ -643,7 +643,7 @@ public class LoginModel : AccountPageModel if (user.TenantId.HasValue) { - identity.AddClaim(new Claim(AbpClaimTypes.TenantId, user.TenantId.ToString())); + identity.AddClaim(new Claim(AbpClaimTypes.TenantId, user.TenantId.Value.ToString())); } await HttpContext.SignInAsync(AbpAccountAuthenticationTypes.ConfirmUserScheme, new ClaimsPrincipal(identity)); @@ -659,7 +659,7 @@ public class LoginModel : AccountPageModel { if (HttpContext?.Request?.Headers?.UserAgent.IsNullOrEmpty() == false) { - var userAgentInfo = HttpUserAgentParserProvider.Parse(HttpContext.Request.Headers.UserAgent); + var userAgentInfo = HttpUserAgentParserProvider.Parse(HttpContext.Request.Headers.UserAgent!); if (userAgentInfo.MobileDeviceType.IsNullOrWhiteSpace()) { QrCodeLoginInput.IsEnabled = true; @@ -727,9 +727,9 @@ public class LoginModel : AccountPageModel { await IdentityLinkUserAppService.LinkAsync(new LinkUserInput { - UserId = LinkUserId.Value, + UserId = LinkUserId!.Value, TenantId = LinkTenantId, - Token = LinkToken + Token = LinkToken! }); await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext() @@ -785,11 +785,11 @@ public class PhoneLoginInputModel : LoginInputModel [Phone] [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] - public string PhoneNumber { get; set; } + public string PhoneNumber { get; set; } = default!; [Required] [StringLength(6)] - public string Code { get; set; } + public string Code { get; set; } = default!; public bool RememberMe { get; set; } } @@ -798,13 +798,13 @@ public class PasswordLoginInputModel : LoginInputModel { [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxEmailLength))] - public string UserNameOrEmailAddress { get; set; } + public string UserNameOrEmailAddress { get; set; } = default!; [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] [DataType(DataType.Password)] [DisableAuditing] - public string Password { get; set; } + public string Password { get; set; } = default!; public bool RememberMe { get; set; } } @@ -812,7 +812,7 @@ public class PasswordLoginInputModel : LoginInputModel public class QrCodeLoginInputModel : LoginInputModel { [HiddenInput] - public string Key { get; set; } + public string Key { get; set; } = default!; [HiddenInput] public bool IsEnabled { get; set; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Register.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Register.cshtml.cs index 36ae6f5dc..070c01665 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Register.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/Register.cshtml.cs @@ -32,20 +32,20 @@ public class RegisterModel : AccountPageModel { [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } + public string ReturnUrl { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } + public string? ReturnUrlHash { get; set; } [BindProperty] - public PostInput Input { get; set; } + public PostInput Input { get; set; } = default!; [BindProperty(SupportsGet = true)] public bool IsExternalLogin { get; set; } [BindProperty(SupportsGet = true)] - public string ExternalLoginAuthSchema { get; set; } + public string? ExternalLoginAuthSchema { get; set; } #region LinkUser [HiddenInput] @@ -58,7 +58,7 @@ public class RegisterModel : AccountPageModel [HiddenInput] [BindProperty(SupportsGet = true)] - public string LinkToken { get; set; } + public string? LinkToken { get; set; } protected ICurrentPrincipalAccessor CurrentPrincipalAccessor => LazyServiceProvider.LazyGetRequiredService(); @@ -66,11 +66,11 @@ public class RegisterModel : AccountPageModel #endregion - public IEnumerable ExternalProviders { get; set; } + public IEnumerable ExternalProviders { get; set; } = default!; public IEnumerable VisibleExternalProviders => ExternalProviders.Where(x => !string.IsNullOrWhiteSpace(x.DisplayName)); public bool EnableLocalRegister { get; set; } public bool IsExternalLoginOnly => EnableLocalRegister == false && ExternalProviders?.Count() == 1; - public string ExternalLoginScheme => IsExternalLoginOnly ? ExternalProviders?.SingleOrDefault()?.AuthenticationScheme : null; + public string? ExternalLoginScheme => IsExternalLoginOnly ? ExternalProviders?.SingleOrDefault()?.AuthenticationScheme : null; protected IExternalProviderService ExternalProviderService { get; } protected IAuthenticationSchemeProvider SchemeProvider { get; } @@ -100,7 +100,7 @@ public class RegisterModel : AccountPageModel { if (IsExternalLoginOnly) { - return await OnPostExternalLogin(ExternalLoginScheme); + return await OnPostExternalLogin(ExternalLoginScheme!); } Alerts.Warning(L["SelfRegistrationDisabledMessage"]); @@ -265,7 +265,7 @@ public class RegisterModel : AccountPageModel { externalProviderModels.Add(new ExternalLoginProviderModel { - Name = externalLoginProvider.Name, + Name = externalLoginProvider!.Name, AuthenticationScheme = scheme.Name, DisplayName = externalLoginProvider.DisplayName, ComponentType = externalLoginProvider.ComponentType, @@ -276,7 +276,7 @@ public class RegisterModel : AccountPageModel return externalProviderModels; } - protected virtual bool TryGetExternalLoginProvider(AuthenticationScheme scheme, List externalProviders, out ExternalLoginProviderModel externalLoginProvider) + protected virtual bool TryGetExternalLoginProvider(AuthenticationScheme scheme, List externalProviders, out ExternalLoginProviderModel? externalLoginProvider) { if (ReflectionHelper.IsAssignableToGenericType(scheme.HandlerType, typeof(RemoteAuthenticationHandler<>))) { @@ -304,9 +304,9 @@ public class RegisterModel : AccountPageModel { await IdentityLinkUserAppService.LinkAsync(new LinkUserInput { - UserId = LinkUserId.Value, + UserId = LinkUserId!.Value, TenantId = LinkTenantId, - Token = LinkToken + Token = LinkToken! }); await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext() @@ -358,18 +358,18 @@ public class RegisterModel : AccountPageModel { [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] - public string UserName { get; set; } + public string UserName { get; set; } = default!; [Required] [EmailAddress] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxEmailLength))] - public string EmailAddress { get; set; } + public string EmailAddress { get; set; } = default!; [Required] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] [DataType(DataType.Password)] [DisableAuditing] - public string Password { get; set; } + public string Password { get; set; } = default!; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml.cs index 5acd7c01d..eb25accb6 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendCode.cshtml.cs @@ -16,15 +16,15 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account public class SendCodeModel : AccountPageModel { [BindProperty] - public SendCodeInputModel Input { get; set; } + public SendCodeInputModel Input { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } + public string ReturnUrl { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } + public string? ReturnUrlHash { get; set; } [HiddenInput] [BindProperty(SupportsGet = true)] @@ -40,9 +40,9 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account [HiddenInput] [BindProperty(SupportsGet = true)] - public string LinkToken { get; set; } + public string? LinkToken { get; set; } - public IEnumerable Providers { get; set; } + public IEnumerable Providers { get; set; } = default!; protected ISmsSender SmsSender { get; } @@ -117,7 +117,7 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account Check.NotNullOrWhiteSpace(templateCode, nameof(IdentitySettingNames.User.SmsUserSignin)); // TODO: Ժչģ巢 - var smsMessage = new SmsMessage(phoneNumber, code); + var smsMessage = new SmsMessage(phoneNumber!, code); smsMessage.Properties.Add("code", code); smsMessage.Properties.Add("TemplateCode", templateCode); @@ -139,6 +139,6 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account public class SendCodeInputModel { - public string SelectedProvider { get; set; } + public string SelectedProvider { get; set; } = default!; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendEmailConfirm.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendEmailConfirm.cshtml.cs index 871fc5e95..5f575c290 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendEmailConfirm.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/SendEmailConfirm.cshtml.cs @@ -10,17 +10,17 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account public class SendEmailConfirmModel : AccountPageModel { [BindProperty(SupportsGet = true)] - public string Email { get; set; } + public string Email { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } + public string ReturnUrl { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } + public string? ReturnUrlHash { get; set; } - public IMyProfileAppService MyProfileAppService { get; set; } + public IMyProfileAppService MyProfileAppService => LazyServiceProvider.LazyGetRequiredService(); public SendEmailConfirmModel() { @@ -29,7 +29,7 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account public virtual Task OnGetAsync() { - Email = CurrentUser.Email; + Email = CurrentUser.Email!; return Task.FromResult(Page()); } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml.cs index 5704b5923..8135ad8b1 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyAuthenticatorCode.cshtml.cs @@ -9,15 +9,15 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account public class VerifyAuthenticatorCodeModel : AccountPageModel { [BindProperty] - public VerifyAuthenticatorCodeInputModel Input { get; set; } + public VerifyAuthenticatorCodeInputModel Input { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } + public string ReturnUrl { get; set; } = default!; [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } + public string? ReturnUrlHash { get; set; } [BindProperty(SupportsGet = true)] public bool RememberBrowser { get; set; } @@ -56,6 +56,6 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account public class VerifyAuthenticatorCodeInputModel { [Required] - public string VerifyCode { get; set; } + public string VerifyCode { get; set; } = default!; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml index 1de054f64..c91abeb42 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml @@ -15,7 +15,7 @@ - +
diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml.cs index 008695c12..cf9860ea1 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Web/Pages/Account/VerifyCode.cshtml.cs @@ -16,25 +16,25 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account protected IdentityDynamicClaimsPrincipalContributorCache IdentityDynamicClaimsPrincipalContributorCache { get; } [BindProperty] - public VerifyCodeInputModel Input { get; set; } + public VerifyCodeInputModel Input { get; set; } = default!; /// /// ˫֤ṩ /// [HiddenInput] [BindProperty(SupportsGet = true)] - public string Provider { get; set; } + public string Provider { get; set; } = default!; /// /// ضUrl /// [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } + public string ReturnUrl { get; set; } = default!; /// /// /// [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrlHash { get; set; } + public string? ReturnUrlHash { get; set; } /// /// Ƿס¼״̬ /// @@ -53,7 +53,7 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account [HiddenInput] [BindProperty(SupportsGet = true)] - public string LinkToken { get; set; } + public string? LinkToken { get; set; } protected ICurrentPrincipalAccessor CurrentPrincipalAccessor => LazyServiceProvider.LazyGetRequiredService(); @@ -118,9 +118,9 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account { await IdentityLinkUserAppService.LinkAsync(new LinkUserInput { - UserId = LinkUserId.Value, + UserId = LinkUserId!.Value, TenantId = LinkTenantId, - Token = LinkToken + Token = LinkToken! }); await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext() @@ -179,6 +179,6 @@ namespace LINGYUN.Abp.Account.Web.Pages.Account /// ͵֤ /// [Required] - public string VerifyCode { get; set; } + public string VerifyCode { get; set; } = default!; } } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ChatMessageDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ChatMessageDto.cs index 02e161331..29287edb9 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ChatMessageDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ChatMessageDto.cs @@ -4,11 +4,11 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.AIManagement.Chats.Dtos; public abstract class ChatMessageDto : ExtensibleAuditedEntityDto { - public string Workspace { get; set; } + public string Workspace { get; set; } = default!; public DateTime CreatedAt { get; set; } - public string Role { get; set; } + public string Role { get; set; } = default!; public Guid? UserId { get; set; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationCreateDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationCreateDto.cs index e8ad0a33b..01c5250ed 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationCreateDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationCreateDto.cs @@ -10,6 +10,6 @@ public class ConversationCreateDto [Required] [DynamicStringLength(typeof(WorkspaceDefinitionRecordConsts), nameof(WorkspaceDefinitionRecordConsts.MaxNameLength))] - public string Workspace { get; set; } + public string Workspace { get; set; } = default!; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationDto.cs index 5a64ac79e..f2a378495 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationDto.cs @@ -4,9 +4,9 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.AIManagement.Chats.Dtos; public class ConversationDto : AuditedEntityDto { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string Workspace { get; set; } + public string Workspace { get; set; } = default!; public DateTime CreatedAt { get; set; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationUpdateDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationUpdateDto.cs index 4469eba6d..b06d8ed5e 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationUpdateDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/ConversationUpdateDto.cs @@ -6,5 +6,5 @@ public class ConversationUpdateDto { [Required] [DynamicStringLength(typeof(ConversationRecordConsts), nameof(ConversationRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/SendTextChatMessageDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/SendTextChatMessageDto.cs index a36641a54..09b718c9d 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/SendTextChatMessageDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/SendTextChatMessageDto.cs @@ -11,9 +11,9 @@ public class SendTextChatMessageDto [Required] [DynamicStringLength(typeof(WorkspaceDefinitionRecordConsts), nameof(WorkspaceDefinitionRecordConsts.MaxNameLength))] - public string Workspace { get; set; } + public string Workspace { get; set; } = default!; [Required] [DynamicStringLength(typeof(TextChatMessageRecordConsts), nameof(TextChatMessageRecordConsts.MaxContentLength))] - public string Content { get; set; } + public string Content { get; set; } = default!; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/TextChatMessageDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/TextChatMessageDto.cs index 1709662c2..872b7f40a 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/TextChatMessageDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Chats/Dtos/TextChatMessageDto.cs @@ -1,5 +1,5 @@ namespace LINGYUN.Abp.AIManagement.Chats.Dtos; public class TextChatMessageDto : ChatMessageDto { - public string Content { get; set; } + public string Content { get; set; } = default!; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordCreateDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordCreateDto.cs index c2b74f3fd..23f00d514 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordCreateDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordCreateDto.cs @@ -6,5 +6,5 @@ public class AIToolDefinitionRecordCreateDto : AIToolDefinitionRecordCreateOrUpd { [Required] [DynamicStringLength(typeof(AIToolDefinitionRecordConsts), nameof(AIToolDefinitionRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordCreateOrUpdateDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordCreateOrUpdateDto.cs index 1342491b5..3e03e9fa7 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordCreateOrUpdateDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordCreateOrUpdateDto.cs @@ -7,7 +7,7 @@ public abstract class AIToolDefinitionRecordCreateOrUpdateDto : ExtensibleObject { [Required] [DynamicStringLength(typeof(AIToolDefinitionRecordConsts), nameof(AIToolDefinitionRecordConsts.MaxProviderLength))] - public string Provider { get; set; } + public string Provider { get; set; } = default!; [DynamicStringLength(typeof(AIToolDefinitionRecordConsts), nameof(AIToolDefinitionRecordConsts.MaxDescriptionLength))] public string? Description { get; set; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordDto.cs index 718c8e1a7..e6281f7b4 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordDto.cs @@ -7,9 +7,9 @@ namespace LINGYUN.Abp.AIManagement.Tools.Dtos; [Serializable] public class AIToolDefinitionRecordDto : ExtensibleAuditedEntityDto, IHasConcurrencyStamp { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string Provider { get; set; } + public string Provider { get; set; } = default!; public string? Description { get; set; } @@ -21,5 +21,5 @@ public class AIToolDefinitionRecordDto : ExtensibleAuditedEntityDto, IHasC public string? StateCheckers { get; set; } - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordUpdateDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordUpdateDto.cs index c0bdc0c81..fc1517c91 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordUpdateDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolDefinitionRecordUpdateDto.cs @@ -6,5 +6,5 @@ public class AIToolDefinitionRecordUpdateDto : AIToolDefinitionRecordCreateOrUpd { [Required] [StringLength(40)] - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolPropertyDescriptorDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolPropertyDescriptorDto.cs index 9a83898c2..5dd45f672 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolPropertyDescriptorDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Tools/Dtos/AIToolPropertyDescriptorDto.cs @@ -4,11 +4,11 @@ using Volo.Abp; namespace LINGYUN.Abp.AIManagement.Tools.Dtos; public class AIToolPropertyDescriptorDto { - public string Name { get; set; } + public string Name { get; set; } = default!; public bool Required { get; set; } - public string ValueType { get; set; } - public List> Options { get; set; } - public string DisplayName { get; set; } + public string ValueType { get; set; } = default!; + public List> Options { get; set; } = new List>(); + public string DisplayName { get; set; } = default!; public string? Description { get; set; } - public List> Dependencies { get; set; } + public List> Dependencies { get; set; } = new List>(); } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordCreateDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordCreateDto.cs index 9591c2773..8fea2a6b7 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordCreateDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordCreateDto.cs @@ -6,5 +6,5 @@ public class WorkspaceDefinitionRecordCreateDto : WorkspaceDefinitionRecordCreat { [Required] [DynamicStringLength(typeof(WorkspaceDefinitionRecordConsts), nameof(WorkspaceDefinitionRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordCreateOrUpdateDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordCreateOrUpdateDto.cs index 5c94c209e..b2239c0f6 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordCreateOrUpdateDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordCreateOrUpdateDto.cs @@ -8,15 +8,15 @@ public abstract class WorkspaceDefinitionRecordCreateOrUpdateDto : ExtensibleObj { [Required] [DynamicStringLength(typeof(WorkspaceDefinitionRecordConsts), nameof(WorkspaceDefinitionRecordConsts.MaxProviderLength))] - public string Provider { get; set; } + public string Provider { get; set; } = default!; [Required] [DynamicStringLength(typeof(WorkspaceDefinitionRecordConsts), nameof(WorkspaceDefinitionRecordConsts.MaxModelNameLength))] - public string ModelName { get; set; } + public string ModelName { get; set; } = default!; [Required] [DynamicStringLength(typeof(WorkspaceDefinitionRecordConsts), nameof(WorkspaceDefinitionRecordConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(WorkspaceDefinitionRecordConsts), nameof(WorkspaceDefinitionRecordConsts.MaxDescriptionLength))] public string? Description { get; set; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordDto.cs index 140959dc7..1e62f15d5 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordDto.cs @@ -7,13 +7,13 @@ namespace LINGYUN.Abp.AIManagement.Workspaces.Dtos; [Serializable] public class WorkspaceDefinitionRecordDto : ExtensibleAuditedEntityDto, IHasConcurrencyStamp { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string Provider { get; set; } + public string Provider { get; set; } = default!; - public string ModelName { get; set; } + public string ModelName { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public string? Description { get; set; } @@ -35,9 +35,9 @@ public class WorkspaceDefinitionRecordDto : ExtensibleAuditedEntityDto, IH public bool IsSystem { get; set; } - public string[] Tools { get; set; } + public string[]? Tools { get; set; } public string? StateCheckers { get; set; } - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordUpdateDto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordUpdateDto.cs index 848ef7394..cf82d855a 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordUpdateDto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Application.Contracts/LINGYUN/Abp/AIManagement/Workspaces/Dtos/WorkspaceDefinitionRecordUpdateDto.cs @@ -6,5 +6,5 @@ public class WorkspaceDefinitionRecordUpdateDto : WorkspaceDefinitionRecordCreat { [Required] [StringLength(40)] - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Chats/ChatMessageRecordEto.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Chats/ChatMessageRecordEto.cs index 3fff98fcd..c081df8e1 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Chats/ChatMessageRecordEto.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain.Shared/LINGYUN/Abp/AIManagement/Chats/ChatMessageRecordEto.cs @@ -6,6 +6,6 @@ namespace LINGYUN.Abp.AIManagement.Chats; public abstract class ChatMessageRecordEto : EntityEto, IMultiTenant { public Guid? TenantId { get; set; } - public string Workspace { get; set; } + public string Workspace { get; set; } = default!; public Guid? ConversationId { get; set; } } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Chats/ChatMessageRecord.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Chats/ChatMessageRecord.cs index 805aaadd3..b3383db28 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Chats/ChatMessageRecord.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Chats/ChatMessageRecord.cs @@ -9,7 +9,7 @@ public abstract class ChatMessageRecord : AuditedAggregateRoot, IMultiTena { public Guid? TenantId { get; private set; } - public string Workspace { get; private set; } + public string Workspace { get; private set; } = default!; public ChatRole Role { get; private set; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Chats/TextChatMessageRecord.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Chats/TextChatMessageRecord.cs index 16efa2653..88bf7917f 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Chats/TextChatMessageRecord.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Chats/TextChatMessageRecord.cs @@ -5,7 +5,7 @@ using Volo.Abp; namespace LINGYUN.Abp.AIManagement.Chats; public class TextChatMessageRecord : ChatMessageRecord { - public string Content { get; private set; } + public string Content { get; private set; } = default!; public TextChatMessageRecord() { diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/AIToolDefinitionRecord.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/AIToolDefinitionRecord.cs index 6a3eacd23..4e52969aa 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/AIToolDefinitionRecord.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/AIToolDefinitionRecord.cs @@ -7,9 +7,9 @@ using Volo.Abp.Domain.Entities.Auditing; namespace LINGYUN.Abp.AIManagement.Tools; public class AIToolDefinitionRecord : AuditedAggregateRoot { - public string Name { get; private set; } + public string Name { get; private set; } = default!; - public string Provider { get; private set; } + public string Provider { get; private set; } = default!; public string? Description { get; set; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/DynamicAIToolDefinitionStoreInMemoryCache.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/DynamicAIToolDefinitionStoreInMemoryCache.cs index 243cf4bfc..bad17692a 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/DynamicAIToolDefinitionStoreInMemoryCache.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/DynamicAIToolDefinitionStoreInMemoryCache.cs @@ -11,7 +11,7 @@ using Volo.Abp.SimpleStateChecking; namespace LINGYUN.Abp.AIManagement.Tools; public class DynamicAIToolDefinitionStoreInMemoryCache : IDynamicAIToolDefinitionStoreInMemoryCache, ISingletonDependency { - public string CacheStamp { get; set; } + public string? CacheStamp { get; set; } protected IDictionary AIToolDefinitions { get; } protected ISimpleStateCheckerSerializer StateCheckerSerializer { get; } protected ILocalizableStringSerializer LocalizableStringSerializer { get; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/IDynamicAIToolDefinitionStoreInMemoryCache.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/IDynamicAIToolDefinitionStoreInMemoryCache.cs index 108dd095b..d585085d9 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/IDynamicAIToolDefinitionStoreInMemoryCache.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Tools/IDynamicAIToolDefinitionStoreInMemoryCache.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace LINGYUN.Abp.AIManagement.Tools; public interface IDynamicAIToolDefinitionStoreInMemoryCache { - string CacheStamp { get; set; } + string? CacheStamp { get; set; } SemaphoreSlim SyncSemaphore { get; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStoreInMemoryCache.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStoreInMemoryCache.cs index 7baf9dfd5..99ac29d1c 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStoreInMemoryCache.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/DynamicWorkspaceDefinitionStoreInMemoryCache.cs @@ -12,7 +12,7 @@ using Volo.Abp.SimpleStateChecking; namespace LINGYUN.Abp.AIManagement.Workspaces; public class DynamicWorkspaceDefinitionStoreInMemoryCache : IDynamicWorkspaceDefinitionStoreInMemoryCache, ISingletonDependency { - public string CacheStamp { get; set; } + public string? CacheStamp { get; set; } protected IDictionary WorkspaceDefinitions { get; } protected IStringEncryptionService StringEncryptionService { get; } protected ISimpleStateCheckerSerializer StateCheckerSerializer { get; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IDynamicWorkspaceDefinitionStoreInMemoryCache.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IDynamicWorkspaceDefinitionStoreInMemoryCache.cs index 3d3f1a1b9..52588ce09 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IDynamicWorkspaceDefinitionStoreInMemoryCache.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/IDynamicWorkspaceDefinitionStoreInMemoryCache.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Abp.AIManagement.Workspaces; public interface IDynamicWorkspaceDefinitionStoreInMemoryCache { - string CacheStamp { get; set; } + string? CacheStamp { get; set; } SemaphoreSlim SyncSemaphore { get; } diff --git a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionRecord.cs b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionRecord.cs index 93ea50252..d4b2444e7 100644 --- a/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionRecord.cs +++ b/aspnet-core/modules/ai/LINGYUN.Abp.AIManagement.Domain/LINGYUN/Abp/AIManagement/Workspaces/WorkspaceDefinitionRecord.cs @@ -7,13 +7,13 @@ using Volo.Abp.Domain.Entities.Auditing; namespace LINGYUN.Abp.AIManagement.Workspaces; public class WorkspaceDefinitionRecord : AuditedAggregateRoot { - public string Name { get; private set; } + public string Name { get; private set; } = default!; - public string Provider { get; private set; } + public string Provider { get; private set; } = default!; - public string ModelName { get; private set; } + public string ModelName { get; private set; } = default!; - public string DisplayName { get; private set; } + public string DisplayName { get; private set; } = default!; public string? Description { get; set; } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogActionDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogActionDto.cs index 44365705f..7f0c02d46 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogActionDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogActionDto.cs @@ -5,11 +5,11 @@ namespace LINGYUN.Abp.Auditing.AuditLogs; public class AuditLogActionDto : ExtensibleEntityDto { - public string ServiceName { get; set; } + public string? ServiceName { get; set; } - public string MethodName { get; set; } + public string? MethodName { get; set; } - public string Parameters { get; set; } + public string? Parameters { get; set; } public DateTime ExecutionTime { get; set; } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDeleteManyInput.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDeleteManyInput.cs index f09eb6edc..4fa7ffac1 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDeleteManyInput.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDeleteManyInput.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.Auditing.AuditLogs; public class AuditLogDeleteManyInput { [Required] - public List Ids { get; set; } + public List Ids { get; set; } = default!; } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDto.cs index 17b5c5c0f..3ae74dc4a 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDto.cs @@ -6,45 +6,45 @@ namespace LINGYUN.Abp.Auditing.AuditLogs; public class AuditLogDto : ExtensibleEntityDto { - public string ApplicationName { get; set; } + public string? ApplicationName { get; set; } public Guid? UserId { get; set; } - public string UserName { get; set; } + public string? UserName { get; set; } public Guid? TenantId { get; set; } - public string TenantName { get; set; } + public string? TenantName { get; set; } public Guid? ImpersonatorUserId { get; set; } - public string ImpersonatorUserName { get; set; } + public string? ImpersonatorUserName { get; set; } public Guid? ImpersonatorTenantId { get; set; } - public string ImpersonatorTenantName { get; set; } + public string? ImpersonatorTenantName { get; set; } public DateTime ExecutionTime { get; set; } public int ExecutionDuration { get; set; } - public string ClientIpAddress { get; set; } + public string? ClientIpAddress { get; set; } - public string ClientName { get; set; } + public string? ClientName { get; set; } - public string ClientId { get; set; } + public string? ClientId { get; set; } - public string CorrelationId { get; set; } + public string? CorrelationId { get; set; } - public string BrowserInfo { get; set; } + public string? BrowserInfo { get; set; } - public string HttpMethod { get; set; } + public string? HttpMethod { get; set; } - public string Url { get; set; } + public string? Url { get; set; } - public string Exceptions { get; set; } + public string? Exceptions { get; set; } - public string Comments { get; set; } + public string? Comments { get; set; } public int? HttpStatusCode { get; set; } public List EntityChanges { get; set; } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs index c46830e27..5eb89c9ee 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs @@ -8,14 +8,14 @@ public class AuditLogGetByPagedDto : PagedAndSortedResultRequestDto { public DateTime? StartTime { get; set; } public DateTime? EndTime { get; set; } - public string HttpMethod { get; set; } - public string Url { get; set; } + public string? HttpMethod { get; set; } + public string? Url { get; set; } public Guid? UserId { get; set; } - public string UserName { get; set; } - public string ApplicationName { get; set; } - public string CorrelationId { get; set; } - public string ClientId { get; set; } - public string ClientIpAddress { get; set; } + public string? UserName { get; set; } + public string? ApplicationName { get; set; } + public string? CorrelationId { get; set; } + public string? ClientId { get; set; } + public string? ClientIpAddress { get; set; } public int? MaxExecutionDuration { get; set; } public int? MinExecutionDuration { get; set; } public bool? HasException { get; set; } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeDto.cs index 12a54abb4..0810de942 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeDto.cs @@ -13,9 +13,9 @@ public class EntityChangeDto : ExtensibleEntityDto public Guid? EntityTenantId { get; set; } - public string EntityId { get; set; } + public string EntityId { get; set; } = default!; - public string EntityTypeFullName { get; set; } + public string EntityTypeFullName { get; set; } = default!; public List PropertyChanges { get; set; } public EntityChangeDto() { diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeGetByPagedDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeGetByPagedDto.cs index 85a1a651f..e60c8109c 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeGetByPagedDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeGetByPagedDto.cs @@ -10,6 +10,6 @@ public class EntityChangeGetByPagedDto : PagedAndSortedResultRequestDto public DateTime? StartTime { get; set; } public DateTime? EndTime { get; set; } public EntityChangeType? ChangeType { get; set; } - public string EntityId { get; set; } - public string EntityTypeFullName { get; set; } + public string? EntityId { get; set; } + public string? EntityTypeFullName { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeGetWithUsernameDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeGetWithUsernameDto.cs index 9c962119e..e54d25023 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeGetWithUsernameDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeGetWithUsernameDto.cs @@ -2,6 +2,6 @@ public class EntityChangeGetWithUsernameDto { - public string EntityId { get; set; } - public string EntityTypeFullName { get; set; } + public string EntityId { get; set; } = default!; + public string EntityTypeFullName { get; set; } = default!; } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeWithUsernameDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeWithUsernameDto.cs index 5da2e0c32..05aceb275 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeWithUsernameDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeWithUsernameDto.cs @@ -1,7 +1,7 @@ namespace LINGYUN.Abp.Auditing.AuditLogs; public class EntityChangeWithUsernameDto { - public EntityChangeDto EntityChange { get; set; } + public EntityChangeDto EntityChange { get; set; } = default!; - public string UserName { get; set; } + public string UserName { get; set; } = default!; } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs index 2c625710d..107985796 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs @@ -5,11 +5,11 @@ namespace LINGYUN.Abp.Auditing.AuditLogs; public class EntityPropertyChangeDto : EntityDto { - public string NewValue { get; set; } + public string? NewValue { get; set; } - public string OriginalValue { get; set; } + 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!; } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IAuditLogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IAuditLogAppService.cs index a2b367f98..2bf0b36f3 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IAuditLogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IAuditLogAppService.cs @@ -9,7 +9,7 @@ public interface IAuditLogAppService : IApplicationService { Task> GetListAsync(AuditLogGetByPagedDto input); - Task GetAsync(Guid id); + Task GetAsync(Guid id); Task DeleteAsync(Guid id); diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IEntityChangesAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IEntityChangesAppService.cs index 9bb561963..2b1b8f42f 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IEntityChangesAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IEntityChangesAppService.cs @@ -7,9 +7,9 @@ namespace LINGYUN.Abp.Auditing.AuditLogs; public interface IEntityChangesAppService : IApplicationService { - Task GetAsync(Guid id); + Task GetAsync(Guid id); - Task GetWithUsernameAsync(Guid id); + Task GetWithUsernameAsync(Guid id); Task> GetListAsync(EntityChangeGetByPagedDto input); diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogDto.cs index f33f23385..901931f22 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogDto.cs @@ -8,7 +8,7 @@ public class LogDto { public DateTime TimeStamp { get; set; } public LogLevel Level { get; set; } - public string Message { get; set; } - public LogFieldDto Fields { get; set; } - public List Exceptions { get; set; } + public string? Message { get; set; } + public LogFieldDto Fields { get; set; } = default!; + public List? Exceptions { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogExceptionDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogExceptionDto.cs index ab42da4cc..9046ed613 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogExceptionDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogExceptionDto.cs @@ -3,10 +3,10 @@ public class LogExceptionDto { public int Depth { get; set; } - public string Class { get; set; } - public string Message { get; set; } - public string Source { get; set; } - public string StackTrace { get; set; } + public string? Class { get; set; } + public string? Message { get; set; } + public string? Source { get; set; } + public string? StackTrace { get; set; } public int HResult { get; set; } - public string HelpURL { get; set; } + public string? HelpURL { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogFieldDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogFieldDto.cs index da9c73a68..879cab0a5 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogFieldDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogFieldDto.cs @@ -2,19 +2,19 @@ public class LogFieldDto { - public string Id { get; set; } - public string MachineName { get; set; } - public string Environment { get; set; } - public string Application { get; set; } - public string Context { get; set; } - public string ActionId { get; set; } - public string ActionName { get; set; } - public string RequestId { get; set; } - public string RequestPath { get; set; } - public string ConnectionId { get; set; } - public string CorrelationId { get; set; } - public string ClientId { get; set; } - public string UserId { get; set; } - public int ProcessId { get; set; } - public int ThreadId { get; set; } + public string? Id { get; set; } + public string? MachineName { get; set; } + public string? Environment { get; set; } + public string? Application { get; set; } + public string? Context { get; set; } + public string? ActionId { get; set; } + public string? ActionName { get; set; } + public string? RequestId { get; set; } + public string? RequestPath { get; set; } + public string? ConnectionId { get; set; } + public string? CorrelationId { get; set; } + public string? ClientId { get; set; } + public string? UserId { get; set; } + public int? ProcessId { get; set; } + public int? ThreadId { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogGetByPagedDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogGetByPagedDto.cs index 3464cc51d..336861274 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogGetByPagedDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogGetByPagedDto.cs @@ -9,13 +9,13 @@ public class LogGetByPagedDto : PagedAndSortedResultRequestDto public DateTime? StartTime { get; set; } public DateTime? EndTime { get; set; } public LogLevel? Level { get; set; } - public string MachineName { get; set; } - public string Environment { get; set; } - public string Application { get; set; } - public string Context { get; set; } - public string RequestId { get; set; } - public string RequestPath { get; set; } - public string CorrelationId { get; set; } + public string? MachineName { get; set; } + public string? Environment { get; set; } + public string? Application { get; set; } + public string? Context { get; set; } + public string? RequestId { get; set; } + public string? RequestPath { get; set; } + public string? CorrelationId { get; set; } public int? ProcessId { get; set; } public int? ThreadId { get; set; } public bool? HasException { get; set; } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/ILogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/ILogAppService.cs index 090fcaf04..516419ee9 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/ILogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/ILogAppService.cs @@ -1,5 +1,4 @@ -using System; -using System.Threading.Tasks; +using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; @@ -7,7 +6,7 @@ namespace LINGYUN.Abp.Auditing.Logging; public interface ILogAppService : IApplicationService { - Task GetAsync(string id); + Task GetAsync(string id); Task> GetListAsync(LogGetByPagedDto input); } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/ISecurityLogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/ISecurityLogAppService.cs index c9455018a..ba6f359d9 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/ISecurityLogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/ISecurityLogAppService.cs @@ -9,7 +9,7 @@ public interface ISecurityLogAppService : IApplicationService { Task> GetListAsync(SecurityLogGetByPagedDto input); - Task GetAsync(Guid id); + Task GetAsync(Guid id); Task DeleteAsync(Guid id); diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDeleteManyInput.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDeleteManyInput.cs index 8cdb684d4..532dbb442 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDeleteManyInput.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDeleteManyInput.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.Auditing.SecurityLogs; public class SecurityLogDeleteManyInput { [Required] - public List Ids { get; set; } + public List Ids { get; set; } = default!; } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDto.cs index a86440fb7..c30950722 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDto.cs @@ -5,25 +5,25 @@ namespace LINGYUN.Abp.Auditing.SecurityLogs; public class SecurityLogDto : ExtensibleEntityDto { - public string ApplicationName { get; set; } + public string? ApplicationName { get; set; } - public string Identity { get; set; } + public string? Identity { get; set; } - public string Action { get; set; } + public string? Action { get; set; } public Guid? UserId { get; set; } - public string UserName { get; set; } + public string? UserName { get; set; } - public string TenantName { get; set; } + public string? TenantName { get; set; } - public string ClientId { get; set; } + public string? ClientId { get; set; } - public string CorrelationId { get; set; } + public string? CorrelationId { get; set; } - public string ClientIpAddress { get; set; } + public string? ClientIpAddress { get; set; } - public string BrowserInfo { get; set; } + public string? BrowserInfo { get; set; } public DateTime CreationTime { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs index 4cfe6e547..9d57c63b7 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs @@ -7,11 +7,11 @@ public class SecurityLogGetByPagedDto : PagedAndSortedResultRequestDto { public DateTime? StartTime { get; set; } public DateTime? EndTime { get; set; } - public string ApplicationName { get; set; } - public string Identity { get; set; } - public string ActionName { get; set; } + public string? ApplicationName { get; set; } + public string? Identity { get; set; } + public string? ActionName { get; set; } public Guid? UserId { get; set; } - public string UserName { get; set; } - public string ClientId { get; set; } - public string CorrelationId { get; set; } + public string? UserName { get; set; } + public string? ClientId { get; set; } + public string? CorrelationId { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/AuditLogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/AuditLogAppService.cs index 68125b9f4..5d67286bf 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/AuditLogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/AuditLogAppService.cs @@ -22,11 +22,11 @@ public class AuditLogAppService : AuditingApplicationServiceBase, IAuditLogAppSe AuditLogManager = auditLogManager; } - public async virtual Task GetAsync(Guid id) + public async virtual Task GetAsync(Guid id) { var auditLog = await AuditLogManager.GetAsync(id, includeDetails: true); - return ObjectMapper.Map(auditLog); + return ObjectMapper.Map(auditLog); } public async virtual Task> GetListAsync(AuditLogGetByPagedDto input) diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/EntityChangesAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/EntityChangesAppService.cs index 169e4b037..7fffcc424 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/EntityChangesAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/EntityChangesAppService.cs @@ -22,11 +22,11 @@ public class EntityChangesAppService : AuditingApplicationServiceBase, IEntityCh EntityChangeStore = entityChangeStore; } - public async virtual Task GetAsync(Guid id) + public async virtual Task GetAsync(Guid id) { var entityChange = await EntityChangeStore.GetAsync(id); - return ObjectMapper.Map(entityChange); + return ObjectMapper.Map(entityChange); } public async virtual Task> GetListAsync(EntityChangeGetByPagedDto input) @@ -44,11 +44,11 @@ public class EntityChangesAppService : AuditingApplicationServiceBase, IEntityCh ObjectMapper.Map, List>(entityChanges)); } - public async virtual Task GetWithUsernameAsync(Guid id) + public async virtual Task GetWithUsernameAsync(Guid id) { var entityChangeWithUsername = await EntityChangeStore.GetWithUsernameAsync(id); - return ObjectMapper.Map(entityChangeWithUsername); + return ObjectMapper.Map(entityChangeWithUsername); } public async virtual Task> GetWithUsernameAsync(EntityChangeGetWithUsernameDto input) diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/Logging/LogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/Logging/LogAppService.cs index e036227c9..70cc856ce 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/Logging/LogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/Logging/LogAppService.cs @@ -20,11 +20,11 @@ public class LogAppService : AuditingApplicationServiceBase, ILogAppService _manager = manager; } - public async virtual Task GetAsync(string id) + public async virtual Task GetAsync(string id) { var log = await _manager.GetAsync(id); - return ObjectMapper.Map(log); + return ObjectMapper.Map(log); } public async virtual Task> GetListAsync(LogGetByPagedDto input) diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogAppService.cs index e37a19143..0c4659ebe 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogAppService.cs @@ -20,11 +20,11 @@ public class SecurityLogAppService : AuditingApplicationServiceBase, ISecurityLo SecurityLogManager = securityLogManager; } - public async virtual Task GetAsync(Guid id) + public async virtual Task GetAsync(Guid id) { var securityLog = await SecurityLogManager.GetAsync(id, includeDetails: true); - return ObjectMapper.Map(securityLog); + return ObjectMapper.Map(securityLog); } public async virtual Task> GetListAsync(SecurityLogGetByPagedDto input) diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/AuditLogController.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/AuditLogController.cs index 9f992b4c5..a2146cee1 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/AuditLogController.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/AuditLogController.cs @@ -42,7 +42,7 @@ public class AuditLogController : AbpControllerBase, IAuditLogAppService [HttpGet] [Route("{id}")] - public async virtual Task GetAsync(Guid id) + public async virtual Task GetAsync(Guid id) { return await AuditLogAppService.GetAsync(id); } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/EntityChangesController.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/EntityChangesController.cs index 2d2b98261..2480603af 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/EntityChangesController.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/EntityChangesController.cs @@ -27,7 +27,7 @@ public class EntityChangesController : AbpControllerBase, IEntityChangesAppServi [HttpGet] [Route("{id}")] - public Task GetAsync(Guid id) + public Task GetAsync(Guid id) { return EntityChangeAppService.GetAsync(id); } @@ -40,7 +40,7 @@ public class EntityChangesController : AbpControllerBase, IEntityChangesAppServi [HttpGet] [Route("with-username/{id}")] - public Task GetWithUsernameAsync(Guid id) + public Task GetWithUsernameAsync(Guid id) { return EntityChangeAppService.GetWithUsernameAsync(id); } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/Logging/LogController.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/Logging/LogController.cs index ce4e23ba7..c52afe8ab 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/Logging/LogController.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/Logging/LogController.cs @@ -25,7 +25,7 @@ public class LogController : AbpControllerBase, ILogAppService [HttpGet] [Route("{id}")] - public async virtual Task GetAsync(string id) + public async virtual Task GetAsync(string id) { return await _service.GetAsync(id); } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogController.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogController.cs index 35c0ab7ca..249e5f4e0 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogController.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogController.cs @@ -42,7 +42,7 @@ public class SecurityLogController : AbpControllerBase, ISecurityLogAppService [HttpGet] [Route("{id}")] - public async virtual Task GetAsync(Guid id) + public async virtual Task GetAsync(Guid id) { return await SecurityLogAppService.GetAsync(id); } diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobContainerCreateDto.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobContainerCreateDto.cs index d83b76f48..ddf41ab04 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobContainerCreateDto.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobContainerCreateDto.cs @@ -7,5 +7,5 @@ public class BlobContainerCreateDto { [Required] [DynamicStringLength(typeof(BlobContainerConsts), nameof(BlobContainerConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobContainerDto.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobContainerDto.cs index ffb657a7f..960686af8 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobContainerDto.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobContainerDto.cs @@ -6,6 +6,6 @@ namespace LINGYUN.Abp.BlobManagement.Dtos; public class BlobContainerDto : ExtensibleAuditedEntityDto, IHasConcurrencyStamp { - public string Name { get; set; } - public string ConcurrencyStamp { get; set; } + public string Name { get; set; } = default!; + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDownloadByIdInput.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDownloadByIdInput.cs index 5731cadfa..ab3c33681 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDownloadByIdInput.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDownloadByIdInput.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.BlobManagement.Dtos; public class BlobDownloadByIdInput { [Required] - public string Key { get; set; } + public string Key { get; set; } = default!; } diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDownloadByNameInput.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDownloadByNameInput.cs index 06663bc67..8880c7a2a 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDownloadByNameInput.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDownloadByNameInput.cs @@ -10,9 +10,9 @@ public class BlobDownloadByNameInput [Required] [DynamicStringLength(typeof(BlobContainerConsts), nameof(BlobContainerConsts.MaxNameLength))] - public string ContainerName { get; set; } + public string ContainerName { get; set; } = default!; [Required] [DynamicStringLength(typeof(BlobConsts), nameof(BlobConsts.MaxNameLength))] - public string BlobName { get; set; } + public string BlobName { get; set; } = default!; } diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDto.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDto.cs index 83660f0bd..0d62ba7c9 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDto.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobDto.cs @@ -8,11 +8,11 @@ public class BlobDto : ExtensibleAuditedEntityDto /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 全名 /// - public string FullName { get; set; } + public string FullName { get; set; } = default!; /// /// 类型 /// diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobFileCreateBaseDto.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobFileCreateBaseDto.cs index 874256def..48b3e6fcd 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobFileCreateBaseDto.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobFileCreateBaseDto.cs @@ -17,7 +17,7 @@ public abstract class BlobFileCreateBaseDto /// [Required] [DynamicStringLength(typeof(BlobConsts), nameof(BlobConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 所属BlobId /// @@ -27,5 +27,5 @@ public abstract class BlobFileCreateBaseDto /// [DisableAuditing] [DisableValidation] - public IRemoteStreamContent File { get; set; } + public IRemoteStreamContent File { get; set; } = default!; } diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobFolderCreateBaseDto.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobFolderCreateBaseDto.cs index eb7b50ccd..e2d6938ed 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobFolderCreateBaseDto.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Dtos/BlobFolderCreateBaseDto.cs @@ -11,7 +11,7 @@ public abstract class BlobFolderCreateBaseDto /// [Required] [DynamicStringLength(typeof(BlobConsts), nameof(BlobConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 所属BlobId /// diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Integration/Dtos/BlobFileCreateIntegrationDto.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Integration/Dtos/BlobFileCreateIntegrationDto.cs index 86f69508c..e5247f706 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Integration/Dtos/BlobFileCreateIntegrationDto.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Integration/Dtos/BlobFileCreateIntegrationDto.cs @@ -10,5 +10,5 @@ public class BlobFileCreateIntegrationDto : BlobFileGetByNameIntegrationDto [DisableAuditing] [DisableValidation] - public IRemoteStreamContent File { get; set; } + public IRemoteStreamContent File { get; set; } = default!; } diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Integration/Dtos/BlobFileGetByNameIntegrationDto.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Integration/Dtos/BlobFileGetByNameIntegrationDto.cs index a25873fac..c856932a7 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Integration/Dtos/BlobFileGetByNameIntegrationDto.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Application.Contracts/LINGYUN/Abp/BlobManagement/Integration/Dtos/BlobFileGetByNameIntegrationDto.cs @@ -7,9 +7,9 @@ public class BlobFileGetByNameIntegrationDto { [Required] [DynamicStringLength(typeof(BlobContainerConsts), nameof(BlobContainerConsts.MaxNameLength))] - public string ContainerName { get; set; } + public string ContainerName { get; set; } = default!; [Required] [DynamicStringLength(typeof(BlobConsts), nameof(BlobConsts.MaxNameLength))] - public string BlobName { get; set; } + public string BlobName { get; set; } = default!; } diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain.Shared/LINGYUN/Abp/BlobManagement/BlobDownloadEto.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain.Shared/LINGYUN/Abp/BlobManagement/BlobDownloadEto.cs index f5fa5f2fb..46baaeafb 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain.Shared/LINGYUN/Abp/BlobManagement/BlobDownloadEto.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain.Shared/LINGYUN/Abp/BlobManagement/BlobDownloadEto.cs @@ -6,9 +6,9 @@ namespace LINGYUN.Abp.BlobManagement; public class BlobDownloadEto : IMultiTenant { public Guid? TenantId { get; set; } - public string Provider { get; set; } - public string ContainerName { get; set; } - public string FullName { get; set; } + public string Provider { get; set; } = default!; + public string ContainerName { get; set; } = default!; + public string FullName { get; set; } = default!; public BlobDownloadEto() { diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/Blob.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/Blob.cs index 162938e81..8479833a5 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/Blob.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/Blob.cs @@ -21,7 +21,7 @@ public class Blob : AuditedAggregateRoot, IMultiTenant public virtual Guid? ParentId { get; protected set; } - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; public virtual BlobType Type { get; protected set; } @@ -31,9 +31,9 @@ public class Blob : AuditedAggregateRoot, IMultiTenant public virtual DateTime? ExpirationTime { get; protected set; } - public virtual string Provider { get; protected set; } + public virtual string Provider { get; protected set; } = default!; - public virtual string FullName { get; protected set; } + public virtual string FullName { get; protected set; } = default!; public virtual long DownloadCount { get; protected set; } diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobContainer.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobContainer.cs index e050e1af6..9ef372457 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobContainer.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobContainer.cs @@ -10,8 +10,8 @@ namespace LINGYUN.Abp.BlobManagement; public class BlobContainer : AuditedAggregateRoot, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - public virtual string Name { get; protected set; } - public virtual string Provider { get; protected set; } + public virtual string Name { get; protected set; } = default!; + public virtual string Provider { get; protected set; } = default!; protected BlobContainer() { ExtraProperties = new ExtraPropertyDictionary(); diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobDownloadKeyCacheItem.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobDownloadKeyCacheItem.cs index 7072de062..cacaec3a0 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobDownloadKeyCacheItem.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobDownloadKeyCacheItem.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.BlobManagement; [IgnoreMultiTenancy] public class BlobDownloadKeyCacheItem { - public string Url { get; set; } + public string Url { get; set; } = default!; public Guid BlobId { get; set; } public Guid? TenantId { get; set; } public BlobDownloadKeyCacheItem() diff --git a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobUploadFileValidateCacheItem.cs b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobUploadFileValidateCacheItem.cs index 1897819b3..c1a86d1fd 100644 --- a/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobUploadFileValidateCacheItem.cs +++ b/aspnet-core/modules/blob-management/LINGYUN.Abp.BlobManagement.Domain/LINGYUN/Abp/BlobManagement/BlobUploadFileValidateCacheItem.cs @@ -7,7 +7,7 @@ public class BlobUploadFileValidateCacheItem public string[] AllowedExtensions { get; set; } public BlobUploadFileValidateCacheItem() { - + AllowedExtensions = new string[0]; } public BlobUploadFileValidateCacheItem( diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheKeyInput.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheKeyInput.cs index 1d6feb5b2..082101404 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheKeyInput.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheKeyInput.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.CachingManagement; public class CacheKeyInput { [Required] - public string Key { get; set; } + public string Key { get; set; } = default!; } diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheKeysDto.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheKeysDto.cs index 4c52e750a..ed5521b7c 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheKeysDto.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheKeysDto.cs @@ -4,7 +4,7 @@ namespace LINGYUN.Abp.CachingManagement; public class CacheKeysDto { - public string NextMarker { get; set; } + public string NextMarker { get; set; } = default!; public List Keys { get; set; } = new List(); } diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheRefreshInput.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheRefreshInput.cs index 6a4a0a493..b654bd6f6 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheRefreshInput.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheRefreshInput.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.CachingManagement; public class CacheRefreshInput { [Required] - public string Key { get; set; } + public string Key { get; set; } = default!; public DateTime? AbsoluteExpiration { get; set; } public DateTime? SlidingExpiration { get; set; } } diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheRemoveKeysInput.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheRemoveKeysInput.cs index dae9e40e7..6c4b3d9d6 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheRemoveKeysInput.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheRemoveKeysInput.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.CachingManagement; public class CacheRemoveKeysInput { [Required] - public string[] Keys { get; set; } + public string[] Keys { get; set; } = default!; } diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheSetInput.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheSetInput.cs index c3980fbef..712cbad3a 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheSetInput.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheSetInput.cs @@ -5,8 +5,8 @@ namespace LINGYUN.Abp.CachingManagement; public class CacheSetInput { [Required] - public string Key { get; set; } - public string Value { get; set; } + public string Key { get; set; } = default!; + public string? Value { get; set; } public DateTime? AbsoluteExpiration { get; set; } public DateTime? SlidingExpiration { get; set; } } diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheValueDto.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheValueDto.cs index 4d7bda6c7..8a2c97c79 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheValueDto.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/CacheValueDto.cs @@ -5,7 +5,7 @@ namespace LINGYUN.Abp.CachingManagement; public class CacheValueDto { - public string Type { get; set; } + public string Type { get; set; } = default!; public long Size { get; set; } public DateTime? Expiration { get; set; } public IDictionary Values { get; set; } = new Dictionary(); diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/GetCacheKeysInput.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/GetCacheKeysInput.cs index 1a1df4115..b06cdcc59 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/GetCacheKeysInput.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN/Abp/CachingManagement/GetCacheKeysInput.cs @@ -2,7 +2,7 @@ public class GetCacheKeysInput { - public string Prefix { get; set; } - public string Marker { get; set; } - public string Filter { get; set; } + public string? Prefix { get; set; } + public string? Marker { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/CackeKeysResponse.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/CackeKeysResponse.cs index 2c32e4d09..30845ab16 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/CackeKeysResponse.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/CackeKeysResponse.cs @@ -4,12 +4,12 @@ namespace LINGYUN.Abp.CachingManagement; public class CackeKeysResponse { - public string NextMarker { get; } + public string? NextMarker { get; } public IEnumerable Keys { get; } public CackeKeysResponse( - string nextMarker, + string? nextMarker, IEnumerable keys) { NextMarker = nextMarker; diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/GetCacheKeysRequest.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/GetCacheKeysRequest.cs index 3e81c99db..66e742d0b 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/GetCacheKeysRequest.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/GetCacheKeysRequest.cs @@ -2,14 +2,14 @@ public class GetCacheKeysRequest { - public string Prefix { get; } - public string Filter { get; } - public string Marker { get; } + public string? Prefix { get; } + public string? Filter { get; } + public string? Marker { get; } public GetCacheKeysRequest( - string prefix = null, - string filter = null, - string marker = null) + string? prefix = null, + string? filter = null, + string? marker = null) { Prefix = prefix; Filter = filter; diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/ICacheManagerExtensions.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/ICacheManagerExtensions.cs index a31a97448..2470bf84d 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/ICacheManagerExtensions.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN/Abp/CachingManagement/ICacheManagerExtensions.cs @@ -8,9 +8,9 @@ public static class ICacheManagerExtensions { public static Task GetKeysAsync( this ICacheManager cacheManager, - string prefix = null, - string filter = null, - string marker = null, + string? prefix = null, + string? filter = null, + string? marker = null, CancellationToken cancellationToken = default) { return cacheManager.GetKeysAsync( diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs index 06ccde457..0c3f267c2 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs @@ -41,8 +41,8 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc { var type = typeof(RedisCache); - ConnectAsyncMethod = type.GetMethod("ConnectAsync", BindingFlags.Instance | BindingFlags.NonPublic); - MapMetadataMethod = type.GetMethod("MapMetadata", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Static); + ConnectAsyncMethod = type.GetMethod("ConnectAsync", BindingFlags.Instance | BindingFlags.NonPublic)!; + MapMetadataMethod = type.GetMethod("MapMetadata", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Static)!; AbsoluteExpirationKey = type.GetField("AbsoluteExpirationKey", BindingFlags.Static | BindingFlags.NonPublic)!.GetValue(null)!.ToString()!; SlidingExpirationKey = type.GetField("SlidingExpirationKey", BindingFlags.Static | BindingFlags.NonPublic)!.GetValue(null)!.ToString()!; @@ -108,7 +108,7 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc // scan 0 match * count 50000 // redis有自定义的key排序,由传递的marker来确定下一次检索起始位 - var nextCursor = request.Marker ?? "0"; + var nextCursor = request.Marker.IsNullOrWhiteSpace() ? "0" : request.Marker; var scanKeys = new List(); if (!request.Prefix.IsNullOrWhiteSpace() || !request.Filter.IsNullOrWhiteSpace()) @@ -122,12 +122,12 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc break; } - var scanArgs = new object[] { nextCursor, "MATCH", match, "COUNT", ManagementOptions.ScanCount }; + var scanArgs = new object[] { nextCursor!, "MATCH", match, "COUNT", ManagementOptions.ScanCount }; var scanResult = await cache.ExecuteAsync("SCAN", scanArgs); - var results = (RedisResult[])scanResult; - nextCursor = (string)results[0]; - scanKeys.AddRange((string[])results[1]); + var results = (RedisResult[])scanResult!; + nextCursor = (string?)results[0]; + scanKeys.AddRange((string[])results[1]!); dept++; } while (nextCursor != "0"); @@ -136,13 +136,13 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc { var scanArgs = new object[] { nextCursor, "MATCH", match, "COUNT", ManagementOptions.ScanCount }; var scanResult = await cache.ExecuteAsync("SCAN", scanArgs); - var results = (RedisResult[])scanResult; + var results = (RedisResult[])scanResult!; // 第一个返回结果 下一次检索起始位 0复位 // 第二个返回结果为key列表 // https://redis.io/commands/scan/ - nextCursor = (string)results[0]; - scanKeys.AddRange((string[])results[1]); + nextCursor = (string?)results[0]; + scanKeys.AddRange((string[])results[1]!); } return new CackeKeysResponse( @@ -248,7 +248,7 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc await RedisCache.SetAsync( cacheKey, - value, + value!, distributedCacheEntryOptions, cancellationToken); @@ -272,12 +272,12 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc protected virtual ValueTask ConnectAsync(CancellationToken token = default) { - return (ValueTask)ConnectAsyncMethod.Invoke(RedisCache, new object[] { token }); + return (ValueTask)ConnectAsyncMethod.Invoke(RedisCache, new object[] { token })!; } protected virtual void MapMetadata(RedisValue[] results, out DateTimeOffset? absoluteExpiration, out TimeSpan? slidingExpiration) { - var parameters = new object[] { results, null, null }; + var parameters = new object?[] { results, null, null }; MapMetadataMethod.Invoke(this, parameters); absoluteExpiration = (DateTimeOffset?)parameters[1]; diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityEnumInfoDto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityEnumInfoDto.cs index 697b0e743..506034d07 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityEnumInfoDto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityEnumInfoDto.cs @@ -8,13 +8,13 @@ public class EntityEnumInfoDto : EntityDto /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 显示名称 /// - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; /// /// 枚举值 /// - public string Value { get; set; } + public string Value { get; set; } = default!; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityPropertyInfoDto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityPropertyInfoDto.cs index f4be8a3fb..0626beab1 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityPropertyInfoDto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityPropertyInfoDto.cs @@ -8,19 +8,19 @@ public class EntityPropertyInfoDto : EntityDto /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 显示名称 /// - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; /// /// 类型全名 /// - public string TypeFullName { get; set; } + public string TypeFullName { get; set; } = default!; /// /// Js类型 /// - public string JavaScriptType { get; set; } + public string JavaScriptType { get; set; } = default!; /// /// 枚举列表 /// diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityRuleCreateOrUpdateDto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityRuleCreateOrUpdateDto.cs index 71ad9a999..03d91f1b0 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityRuleCreateOrUpdateDto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityRuleCreateOrUpdateDto.cs @@ -11,7 +11,7 @@ public abstract class EntityRuleCreateOrUpdateDto public DataAccessOperation Operation { get; set; } [Required] - public DataAccessFilterGroup FilterGroup { get; set; } + public DataAccessFilterGroup FilterGroup { get; set; } = default!; - public string[] AccessedProperties { get; set; } + public string[]? AccessedProperties { get; set; } } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityRuleDtoBase.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityRuleDtoBase.cs index 5450858a3..3dbbc15ad 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityRuleDtoBase.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityRuleDtoBase.cs @@ -8,8 +8,8 @@ public abstract class EntityRuleDtoBase : AuditedEntityDto public Guid? TenantId { get; set; } public bool IsEnabled { get; set; } public DataAccessOperation Operation { get; set; } - public DataAccessFilterGroup FilterGroup { get; set; } + public DataAccessFilterGroup? FilterGroup { get; set; } public Guid EntityTypeId { get; set; } - public string EntityTypeFullName { get; set; } - public string[] AccessedProperties { get; set; } + public string EntityTypeFullName { get; set; } = default!; + public string[]? AccessedProperties { get; set; } } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityTypeInfoDto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityTypeInfoDto.cs index 8231a701f..85c5df48a 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityTypeInfoDto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/EntityTypeInfoDto.cs @@ -8,15 +8,15 @@ public class EntityTypeInfoDto : AuditedEntityDto /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 显示名称 /// - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; /// /// 类型全名 /// - public string TypeFullName { get; set; } + public string TypeFullName { get; set; } = default!; /// /// 是否启用数据审计 /// diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/GetEntityTypeInfoListInput.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/GetEntityTypeInfoListInput.cs index dbd7701e0..d93fee6b3 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/GetEntityTypeInfoListInput.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/GetEntityTypeInfoListInput.cs @@ -3,7 +3,7 @@ namespace LINGYUN.Abp.DataProtectionManagement; public class GetEntityTypeInfoListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } public bool? IsAuditEnabled { get; set; } } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleCreateDto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleCreateDto.cs index ac765b24d..1130c1cd1 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleCreateDto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleCreateDto.cs @@ -13,5 +13,5 @@ public class OrganizationUnitEntityRuleCreateDto : EntityRuleCreateOrUpdateDto [Required] [DynamicStringLength(typeof(OrganizationUnitEntityRuleConsts), nameof(OrganizationUnitEntityRuleConsts.MaxCodeLength))] - public string OrgCode { get; set; } + public string OrgCode { get; set; } = default!; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleDto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleDto.cs index 68a041da0..1fac12c00 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleDto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.DataProtectionManagement; public class OrganizationUnitEntityRuleDto : EntityRuleDtoBase { public Guid OrgId { get; set; } - public string OrgCode { get; set; } + public string OrgCode { get; set; } = default!; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleGetInput.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleGetInput.cs index 74857c89e..807b4f1ca 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleGetInput.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/OrganizationUnitEntityRuleGetInput.cs @@ -9,7 +9,7 @@ public class OrganizationUnitEntityRuleGetInput { [Required] [DynamicStringLength(typeof(OrganizationUnitEntityRuleConsts), nameof(OrganizationUnitEntityRuleConsts.MaxCodeLength))] - public string OrgCode { get; set; } + public string OrgCode { get; set; } = default!; [Required] public Guid EntityTypeId { get; set; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleCreateDto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleCreateDto.cs index a1630f921..c73a2cbdb 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleCreateDto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleCreateDto.cs @@ -13,5 +13,5 @@ public class RoleEntityRuleCreateDto : EntityRuleCreateOrUpdateDto [Required] [DynamicStringLength(typeof(RoleEntityRuleConsts), nameof(RoleEntityRuleConsts.MaxRuletNameLength))] - public string RoleName { get; set; } + public string RoleName { get; set; } = default!; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleDto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleDto.cs index aeb983e24..2cd85ceef 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleDto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleDto.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.DataProtectionManagement; public class RoleEntityRuleDto : EntityRuleDtoBase { public Guid RoleId { get; set; } - public string RoleName { get; set; } + public string RoleName { get; set; } = default!; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleGetInput.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleGetInput.cs index 9f772c31d..374765304 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleGetInput.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleGetInput.cs @@ -9,7 +9,7 @@ public class RoleEntityRuleGetInput { [Required] [DynamicStringLength(typeof(RoleEntityRuleConsts), nameof(RoleEntityRuleConsts.MaxRuletNameLength))] - public string RoleName { get; set; } + public string RoleName { get; set; } = default!; [Required] public Guid EntityTypeId { get; set; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleInput.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleInput.cs index fd6c8bd59..022e594b0 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleInput.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/RoleEntityRuleInput.cs @@ -10,5 +10,5 @@ public class RoleEntityRuleInput : EntityRuleCreateOrUpdateDto [Required] [DynamicStringLength(typeof(RoleEntityRuleConsts), nameof(RoleEntityRuleConsts.MaxRuletNameLength))] - public string RoleName { get; set; } + public string RoleName { get; set; } = default!; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategyDto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategyDto.cs index 335ff671d..4430c431c 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategyDto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategyDto.cs @@ -5,7 +5,7 @@ namespace LINGYUN.Abp.DataProtectionManagement; public class SubjectStrategyDto { public bool IsEnabled { get; set; } - public string SubjectName { get; set; } - public string SubjectId { get; set; } + public string SubjectName { get; set; } = default!; + public string SubjectId { get; set; } = default!; public DataAccessStrategy Strategy { get; set; } } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategyGetInput.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategyGetInput.cs index 32f6907d3..8dd42f143 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategyGetInput.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategyGetInput.cs @@ -7,9 +7,9 @@ public class SubjectStrategyGetInput { [Required] [DynamicStringLength(typeof(SubjectStrategyConsts), nameof(SubjectStrategyConsts.MaxSubjectNameLength))] - public string SubjectName { get; set; } + public string SubjectName { get; set; } = default!; [Required] [DynamicStringLength(typeof(SubjectStrategyConsts), nameof(SubjectStrategyConsts.MaxSubjectIdLength))] - public string SubjectId { get; set; } + public string SubjectId { get; set; } = default!; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategySetInput.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategySetInput.cs index c4c489792..46bf3f801 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategySetInput.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN/Abp/DataProtectionManagement/Dto/SubjectStrategySetInput.cs @@ -10,11 +10,11 @@ public class SubjectStrategySetInput [Required] [DynamicStringLength(typeof(SubjectStrategyConsts), nameof(SubjectStrategyConsts.MaxSubjectNameLength))] - public string SubjectName { get; set; } + public string SubjectName { get; set; } = default!; [Required] [DynamicStringLength(typeof(SubjectStrategyConsts), nameof(SubjectStrategyConsts.MaxSubjectNameLength))] - public string SubjectId { get; set; } + public string SubjectId { get; set; } = default!; public DataAccessStrategy Strategy { get; set; } } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleAppService.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleAppService.cs index aa148acf1..95f31fdfb 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleAppService.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleAppService.cs @@ -72,10 +72,10 @@ public class OrganizationUnitEntityRuleAppService : DataProtectionManagementAppl entityRule.Operation, entityRule.FilterGroup) { - AccessedProperties = input.AccessedProperties.ToList() + AccessedProperties = input.AccessedProperties?.ToList() ?? [] })); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(entityRule); } @@ -111,10 +111,10 @@ public class OrganizationUnitEntityRuleAppService : DataProtectionManagementAppl entityRule.Operation, entityRule.FilterGroup) { - AccessedProperties = input.AccessedProperties.ToList() + AccessedProperties = input.AccessedProperties?.ToList() ?? [] })); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(entityRule); } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleAppService.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleAppService.cs index fe88502d5..b4b26bb4d 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleAppService.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleAppService.cs @@ -72,10 +72,10 @@ public class RoleEntityRuleAppService : DataProtectionManagementApplicationServi entityRule.Operation, entityRule.FilterGroup) { - AccessedProperties = input.AccessedProperties?.ToList() + AccessedProperties = input.AccessedProperties?.ToList() ?? [] })); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(entityRule); } @@ -112,10 +112,10 @@ public class RoleEntityRuleAppService : DataProtectionManagementApplicationServi entityRule.Operation, entityRule.FilterGroup) { - AccessedProperties = input.AccessedProperties?.ToList() + AccessedProperties = input.AccessedProperties?.ToList() ?? [] })); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(entityRule); } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/EntityRuleBaseEto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/EntityRuleBaseEto.cs index 55cc6e75b..4c7d5a8a4 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/EntityRuleBaseEto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/EntityRuleBaseEto.cs @@ -12,6 +12,6 @@ public abstract class EntityRuleBaseEto : EntityEto, IMultiTenant public bool IsEnabled { get; set; } public DataAccessOperation Operation { get; set; } public Guid EntityTypeId { get; set; } - public string EntityTypeFullName { get; set; } - public DataAccessFilterGroup FilterGroup { get; set; } + public string EntityTypeFullName { get; set; } = default!; + public DataAccessFilterGroup FilterGroup { get; set; } = default!; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/EntityTypeInfoEto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/EntityTypeInfoEto.cs index 28c31c5a9..07ea5e033 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/EntityTypeInfoEto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/EntityTypeInfoEto.cs @@ -11,15 +11,15 @@ public class EntityTypeInfoEto : EntityEto /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 显示名称 /// - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; /// /// 类型全名 /// - public string TypeFullName { get; set; } + public string TypeFullName { get; set; } = default!; /// /// 是否启用数据审计 /// diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleEto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleEto.cs index 4e1392617..c3c0ee25c 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleEto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleEto.cs @@ -8,5 +8,5 @@ namespace LINGYUN.Abp.DataProtectionManagement; public class OrganizationUnitEntityRuleEto : EntityRuleBaseEto { public Guid OrgId { get; set; } - public string OrgCode { get; set; } + public string OrgCode { get; set; } = default!; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleEto.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleEto.cs index 7a2eea91c..39ca2fc48 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleEto.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleEto.cs @@ -8,5 +8,5 @@ namespace LINGYUN.Abp.DataProtectionManagement; public class RoleEntityRuleEto : EntityRuleBaseEto { public Guid RoleId { get; set; } - public string RoleName { get; set; } + public string RoleName { get; set; } = default!; } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementDbProterties.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementDbProterties.cs index ad168fe83..351e24391 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementDbProterties.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementDbProterties.cs @@ -6,7 +6,7 @@ public static class DataProtectionManagementDbProterties { public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix + "Auth"; - public static string DbSchema { get; set; } = null; + public static string? DbSchema { get; set; } = null; public const string ConnectionStringName = "AbpDataProtectionManagement"; diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityEnumInfo.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityEnumInfo.cs index 69f2cd80a..bd0cbc6f9 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityEnumInfo.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityEnumInfo.cs @@ -9,19 +9,19 @@ public class EntityEnumInfo : Entity /// /// 名称 /// - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; /// /// 显示名称 /// - public virtual string DisplayName { get; protected set; } + public virtual string DisplayName { get; protected set; } = default!; /// /// 枚举值 /// - public virtual string Value { get; protected set; } + public virtual string Value { get; protected set; } = default!; /// /// 所属属性 /// - public virtual EntityPropertyInfo PropertyInfo { get; protected set; } + public virtual EntityPropertyInfo PropertyInfo { get; protected set; } = default!; /// /// 所属属性标识 /// diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityPropertyInfo.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityPropertyInfo.cs index b931b01f5..1ed2db3cb 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityPropertyInfo.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityPropertyInfo.cs @@ -13,23 +13,23 @@ public class EntityPropertyInfo : Entity /// /// 名称 /// - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; /// /// 显示名称 /// - public virtual string DisplayName { get; protected set; } + public virtual string DisplayName { get; protected set; } = default!; /// /// 类型全名 /// - public virtual string TypeFullName { get; protected set; } + public virtual string TypeFullName { get; protected set; } = default!; /// /// Js类型 /// - public virtual string JavaScriptType { get; protected set; } + public virtual string JavaScriptType { get; protected set; } = default!; /// /// 所属类型 /// - public virtual EntityTypeInfo TypeInfo { get; protected set; } + public virtual EntityTypeInfo TypeInfo { get; protected set; } = default!; /// /// 所属类型标识 /// @@ -62,7 +62,7 @@ public class EntityPropertyInfo : Entity Enums = new Collection(); } - public EntityEnumInfo FindEnum(string name) + public EntityEnumInfo? FindEnum(string name) { return Enums.FirstOrDefault(x => x.Name == name); } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityRuleBase.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityRuleBase.cs index b6df5c821..005b7c372 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityRuleBase.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityRuleBase.cs @@ -10,11 +10,11 @@ public abstract class EntityRuleBase : AuditedAggregateRoot, IMultiTenant public virtual Guid? TenantId { get; protected set; } public virtual bool IsEnabled { get; set; } public virtual DataAccessOperation Operation { get; set; } - public virtual DataAccessFilterGroup FilterGroup { get; set; } + public virtual DataAccessFilterGroup? FilterGroup { get; set; } public virtual Guid EntityTypeId { get; protected set; } - public virtual string EntityTypeFullName { get; protected set; } - public virtual EntityTypeInfo EntityTypeInfo { get; protected set; } - public virtual string AccessedProperties { get; set; } + public virtual string EntityTypeFullName { get; protected set; } = default!; + public virtual EntityTypeInfo EntityTypeInfo { get; protected set; } = default!; + public virtual string? AccessedProperties { get; set; } protected EntityRuleBase() { } @@ -24,8 +24,8 @@ public abstract class EntityRuleBase : AuditedAggregateRoot, IMultiTenant Guid entityTypeId, string enetityTypeFullName, DataAccessOperation operation, - string accessedProperties = null, - DataAccessFilterGroup filterGroup = null, + string? accessedProperties = null, + DataAccessFilterGroup? filterGroup = null, Guid? tenantId = null) : base(id) { diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityTypeInfo.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityTypeInfo.cs index d4b5cb230..6ace9f016 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityTypeInfo.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/EntityTypeInfo.cs @@ -12,15 +12,15 @@ public class EntityTypeInfo : AuditedAggregateRoot /// /// 名称 /// - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; /// /// 显示名称 /// - public virtual string DisplayName { get; protected set; } + public virtual string DisplayName { get; protected set; } = default!; /// /// 类型全名 /// - public virtual string TypeFullName { get; protected set; } + public virtual string TypeFullName { get; protected set; } = default!; /// /// 是否启用数据审计 /// @@ -49,7 +49,7 @@ public class EntityTypeInfo : AuditedAggregateRoot Properties = new Collection(); } - public EntityPropertyInfo FindProperty(string name) + public EntityPropertyInfo? FindProperty(string name) { return Properties.FirstOrDefault(x => x.Name == name); } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IEntityTypeInfoRepository.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IEntityTypeInfoRepository.cs index cc4e55046..e07be1051 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IEntityTypeInfoRepository.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IEntityTypeInfoRepository.cs @@ -8,7 +8,7 @@ using Volo.Abp.Specifications; namespace LINGYUN.Abp.DataProtectionManagement; public interface IEntityTypeInfoRepository : IBasicRepository { - Task FindByTypeAsync( + Task FindByTypeAsync( string typeFullName, CancellationToken cancellationToken = default); @@ -18,7 +18,7 @@ public interface IEntityTypeInfoRepository : IBasicRepository> GetListAsync( ISpecification specification, - string sorting = nameof(EntityTypeInfo.Id), + string? sorting = nameof(EntityTypeInfo.Id), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IOrganizationUnitEntityRuleRepository.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IOrganizationUnitEntityRuleRepository.cs index 89a032dd6..c3770b1ea 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IOrganizationUnitEntityRuleRepository.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IOrganizationUnitEntityRuleRepository.cs @@ -9,7 +9,7 @@ using Volo.Abp.Specifications; namespace LINGYUN.Abp.DataProtectionManagement; public interface IOrganizationUnitEntityRuleRepository : IBasicRepository { - Task FindEntityRuleAsync( + Task FindEntityRuleAsync( string orgCode, string entityTypeFullName, DataAccessOperation operation = DataAccessOperation.Read, @@ -25,7 +25,7 @@ public interface IOrganizationUnitEntityRuleRepository : IBasicRepository> GetCountAsync( ISpecification specification, - string sorting = nameof(OrganizationUnitEntityRule.EntityTypeFullName), + string? sorting = nameof(OrganizationUnitEntityRule.EntityTypeFullName), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IRoleEntityRuleRepository.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IRoleEntityRuleRepository.cs index 30f9eaafb..7cb144d33 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IRoleEntityRuleRepository.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/IRoleEntityRuleRepository.cs @@ -9,7 +9,7 @@ using Volo.Abp.Specifications; namespace LINGYUN.Abp.DataProtectionManagement; public interface IRoleEntityRuleRepository : IBasicRepository { - Task FindEntityRuleAsync( + Task FindEntityRuleAsync( string roleName, string entityTypeFullName, DataAccessOperation operation = DataAccessOperation.Read, @@ -25,7 +25,7 @@ public interface IRoleEntityRuleRepository : IBasicRepository> GetCountAsync( ISpecification specification, - string sorting = nameof(RoleEntityRule.EntityTypeFullName), + string? sorting = nameof(RoleEntityRule.EntityTypeFullName), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ISubjectStrategyRepository.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ISubjectStrategyRepository.cs index 2fb3f314d..4db7dad8b 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ISubjectStrategyRepository.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ISubjectStrategyRepository.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.DataProtectionManagement; public interface ISubjectStrategyRepository : IBasicRepository { - Task FindBySubjectAsync( + Task FindBySubjectAsync( string subjectName, string subjectId, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRule.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRule.cs index aa578415a..89b546455 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRule.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRule.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.DataProtectionManagement; public class OrganizationUnitEntityRule : EntityRuleBase { public virtual Guid OrgId { get; protected set; } - public virtual string OrgCode { get; protected set; } + public virtual string OrgCode { get; protected set; } = default!; protected OrganizationUnitEntityRule() { @@ -19,8 +19,8 @@ public class OrganizationUnitEntityRule : EntityRuleBase Guid entityTypeId, string entityTypeFullName, DataAccessOperation operation, - string allowProperties = null, - DataAccessFilterGroup filterGroup = null, + string? allowProperties = null, + DataAccessFilterGroup? filterGroup = null, Guid? tenantId = null) : base(id, entityTypeId, entityTypeFullName, operation, allowProperties, filterGroup, tenantId) { diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ProtectedEntitiesSaver.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ProtectedEntitiesSaver.cs index a97728a7f..754842480 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ProtectedEntitiesSaver.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ProtectedEntitiesSaver.cs @@ -93,7 +93,7 @@ public class ProtectedEntitiesSaver : IProtectedEntitiesSaver, ITransientDepende GuidGenerator.Create(), entityType.Name, typeDisplayName ?? entityType.Name, - entityType.FullName, + entityType.FullName!, isDataAudited); var globalIgnoreProperties = Options.GlobalIgnoreProperties.Except(Options.AuditedObjectProperties); @@ -116,7 +116,7 @@ public class ProtectedEntitiesSaver : IProtectedEntitiesSaver, ITransientDepende GuidGenerator, typeProperty.Name, propDisplayName ?? typeProperty.Name, - typeProperty.PropertyType.FullName, + typeProperty.PropertyType.FullName!, javaScriptTypeResult.Type); if (typeProperty.PropertyType.IsEnum) @@ -139,7 +139,7 @@ public class ProtectedEntitiesSaver : IProtectedEntitiesSaver, ITransientDepende propertyInfo.AddEnum( GuidGenerator, enumName, - enumDisplayName, + enumDisplayName!, enumValue.ToString()); } } @@ -173,7 +173,7 @@ public class ProtectedEntitiesSaver : IProtectedEntitiesSaver, ITransientDepende GuidGenerator, typeProperty.Name, propDisplayName ?? typeProperty.Name, - typeProperty.PropertyType.FullName, + typeProperty.PropertyType.FullName!, javaScriptTypeResult.Type); if (typeProperty.PropertyType.IsEnum) @@ -196,7 +196,7 @@ public class ProtectedEntitiesSaver : IProtectedEntitiesSaver, ITransientDepende propertyInfo.AddEnum( GuidGenerator, enumName, - enumDisplayName, + enumDisplayName!, enumValue.ToString()); } } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/RoleEntityRule.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/RoleEntityRule.cs index 9467d535c..264669c02 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/RoleEntityRule.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/RoleEntityRule.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.DataProtectionManagement; public class RoleEntityRule : EntityRuleBase { public virtual Guid RoleId { get; protected set; } - public virtual string RoleName { get; protected set; } + public virtual string RoleName { get; protected set; } = default!; protected RoleEntityRule() { } @@ -18,8 +18,8 @@ public class RoleEntityRule : EntityRuleBase Guid entityTypeId, string entityTypeFullName, DataAccessOperation operation, - string allowProperties = null, - DataAccessFilterGroup filterGroup = null, + string? allowProperties = null, + DataAccessFilterGroup? filterGroup = null, Guid? tenantId = null) : base(id, entityTypeId, entityTypeFullName, operation, allowProperties, filterGroup, tenantId) { diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/SubjectStrategy.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/SubjectStrategy.cs index fb6711d73..0b74e2497 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/SubjectStrategy.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/SubjectStrategy.cs @@ -11,8 +11,8 @@ public class SubjectStrategy : AuditedAggregateRoot, IMultiTenant { public virtual bool IsEnabled { get; set; } public virtual Guid? TenantId { get; protected set; } - public virtual string SubjectName { get; protected set; } - public virtual string SubjectId { get; protected set; } + public virtual string SubjectName { get; protected set; } = default!; + public virtual string SubjectId { get; protected set; } = default!; public virtual DataAccessStrategy Strategy { get; set; } protected SubjectStrategy() { diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/AbpDataProtectionManagementDbContextModelCreatingExtensions.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/AbpDataProtectionManagementDbContextModelCreatingExtensions.cs index be1cd0e59..ab79ab4ea 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/AbpDataProtectionManagementDbContextModelCreatingExtensions.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/AbpDataProtectionManagementDbContextModelCreatingExtensions.cs @@ -11,7 +11,7 @@ namespace LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore { public static void ConfigureDataProtectionManagement( this ModelBuilder builder, - Action optionsAction = null) + Action? optionsAction = null) { Check.NotNull(builder, nameof(builder)); @@ -115,7 +115,7 @@ namespace LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore b.Property(p => p.FilterGroup) .HasColumnName(nameof(RoleEntityRule.FilterGroup)) - .HasConversion(new AbpJsonValueConverter()); + .HasConversion(new AbpJsonValueConverter()); b.HasOne(p => p.EntityTypeInfo) .WithMany() @@ -139,7 +139,7 @@ namespace LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore b.Property(p => p.FilterGroup) .HasColumnName(nameof(RoleEntityRule.FilterGroup)) - .HasConversion(new AbpJsonValueConverter()); + .HasConversion(new AbpJsonValueConverter()); b.HasOne(p => p.EntityTypeInfo) .WithMany() diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/AbpDataProtectionManagementModelBuilderConfigurationOptions.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/AbpDataProtectionManagementModelBuilderConfigurationOptions.cs index 2b1b6350f..a44943a23 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/AbpDataProtectionManagementModelBuilderConfigurationOptions.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/AbpDataProtectionManagementModelBuilderConfigurationOptions.cs @@ -7,7 +7,7 @@ public class AbpDataProtectionManagementModelBuilderConfigurationOptions : AbpMo { public AbpDataProtectionManagementModelBuilderConfigurationOptions( [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) + [CanBeNull] string? schema = null) : base( tablePrefix, schema) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreEntityTypeInfoRepository.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreEntityTypeInfoRepository.cs index 5c64ab26a..66155b3db 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreEntityTypeInfoRepository.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreEntityTypeInfoRepository.cs @@ -18,7 +18,7 @@ public class EfCoreEntityTypeInfoRepository : EfCoreRepository FindByTypeAsync( + public async virtual Task FindByTypeAsync( string typeFullName, CancellationToken cancellationToken = default) { @@ -38,7 +38,7 @@ public class EfCoreEntityTypeInfoRepository : EfCoreRepository> GetListAsync( ISpecification specification, - string sorting = nameof(EntityTypeInfo.Id), + string? sorting = nameof(EntityTypeInfo.Id), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreOrganizationUnitEntityRuleRepository.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreOrganizationUnitEntityRuleRepository.cs index bc446dd99..002bc475e 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreOrganizationUnitEntityRuleRepository.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreOrganizationUnitEntityRuleRepository.cs @@ -20,7 +20,7 @@ public class EfCoreOrganizationUnitEntityRuleRepository : EfCoreRepository FindEntityRuleAsync( + public async virtual Task FindEntityRuleAsync( string orgCode, string entityTypeFullName, DataAccessOperation operation = DataAccessOperation.Read, @@ -50,8 +50,8 @@ public class EfCoreOrganizationUnitEntityRuleRepository : EfCoreRepository> GetCountAsync( - ISpecification specification, - string sorting = nameof(OrganizationUnitEntityRule.EntityTypeFullName), + ISpecification specification, + string? sorting = nameof(OrganizationUnitEntityRule.EntityTypeFullName), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreRoleEntityRuleRepository.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreRoleEntityRuleRepository.cs index e36da44fc..be4130e4f 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreRoleEntityRuleRepository.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreRoleEntityRuleRepository.cs @@ -20,7 +20,7 @@ public class EfCoreRoleEntityRuleRepository : EfCoreRepository FindEntityRuleAsync( + public async virtual Task FindEntityRuleAsync( string roleName, string entityTypeFullName, DataAccessOperation operation = DataAccessOperation.Read, @@ -50,8 +50,8 @@ public class EfCoreRoleEntityRuleRepository : EfCoreRepository> GetCountAsync( - ISpecification specification, - string sorting = nameof(RoleEntityRule.EntityTypeFullName), + ISpecification specification, + string? sorting = nameof(RoleEntityRule.EntityTypeFullName), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreSubjectStrategyRepository.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreSubjectStrategyRepository.cs index 115d00335..3e07374d6 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreSubjectStrategyRepository.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/EfCoreSubjectStrategyRepository.cs @@ -17,7 +17,7 @@ public class EfCoreSubjectStrategyRepository : EfCoreRepository FindBySubjectAsync( + public async virtual Task FindBySubjectAsync( string subjectName, string subjectId, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/AuthorDto.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/AuthorDto.cs index c318f71a4..0542b5791 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/AuthorDto.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/AuthorDto.cs @@ -4,7 +4,7 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.Demo.Authors; public class AuthorDto : EntityDto { - public string Name { get; set; } + public string Name { get; set; } = default!; public DateTime BirthDate { get; set; } diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/CreateAuthorDto.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/CreateAuthorDto.cs index 549b11ea4..10d6c2083 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/CreateAuthorDto.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/CreateAuthorDto.cs @@ -6,7 +6,7 @@ public class CreateAuthorDto { [Required] [StringLength(AuthorConsts.MaxNameLength)] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] public DateTime BirthDate { get; set; } diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/UpdateAuthorDto.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/UpdateAuthorDto.cs index cddbbae6a..b1002e968 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/UpdateAuthorDto.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/UpdateAuthorDto.cs @@ -6,10 +6,10 @@ public class UpdateAuthorDto { [Required] [StringLength(AuthorConsts.MaxNameLength)] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] public DateTime BirthDate { get; set; } - public string ShortBio { get; set; } + public string? ShortBio { get; set; } } diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/AuthorLookupDto.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/AuthorLookupDto.cs index b469e6549..4ba6c01d9 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/AuthorLookupDto.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/AuthorLookupDto.cs @@ -4,5 +4,5 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.Demo.Books; public class AuthorLookupDto : EntityDto { - public string Name { get; set; } + public string Name { get; set; } = default!; } \ No newline at end of file diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookDto.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookDto.cs index 0f4c8f487..673491edf 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookDto.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookDto.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.Demo.Books; public class BookDto : AuditedEntityDto { [DisplayName("名称")] - public string Name { get; set; } + public string Name { get; set; } = default!; [DisplayName("类型")] public BookType Type { get; set; } @@ -20,5 +20,5 @@ public class BookDto : AuditedEntityDto public Guid AuthorId { get; set; } [DisplayName("作者")] - public string AuthorName { get; set; } + public string AuthorName { get; set; } = default!; } diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookExportListInput.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookExportListInput.cs index e8f4de8b2..ba6fd0468 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookExportListInput.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookExportListInput.cs @@ -5,7 +5,7 @@ namespace LINGYUN.Abp.Demo.Books; public class BookExportListInput : LimitedResultRequestDto, ISortedResultRequest { [Required] - public string FileName { get; set; } + public string FileName { get; set; } = default!; public string? Filterr { get; set; } public string? Sorting { get; set; } } diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookImportDto.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookImportDto.cs index 230429b0b..217a535b1 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookImportDto.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookImportDto.cs @@ -8,7 +8,7 @@ public class BookImportDto [Required] [StringLength(128)] [DisplayName("名称")] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] [DisplayName("类型")] @@ -26,5 +26,5 @@ public class BookImportDto public Guid AuthorId { get; set; } [DisplayName("作者")] - public string AuthorName { get; set; } + public string AuthorName { get; set; } = default!; } diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookImportInput.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookImportInput.cs index 74d1a9e31..6aa2a2de3 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookImportInput.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/BookImportInput.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.Demo.Books; public class BookImportInput { [Required] - public IRemoteStreamContent Content { get; set; } + public IRemoteStreamContent Content { get; set; } = default!; } diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/CreateBookDto.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/CreateBookDto.cs index 0b004f49d..7e9b0a359 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/CreateBookDto.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/CreateBookDto.cs @@ -7,7 +7,7 @@ public class CreateBookDto { [Required] [StringLength(128)] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] public BookType Type { get; set; } = BookType.Undefined; diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/UpdateBookDto.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/UpdateBookDto.cs index b31255321..444d493be 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/UpdateBookDto.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/UpdateBookDto.cs @@ -6,7 +6,7 @@ public class UpdateBookDto { [Required] [StringLength(128)] - public string Name { get; set; } + public string Name { get; set; } = default!; public BookType? Type { get; set; } diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application/LINGYUN/Abp/Demo/Books/BookAppService.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application/LINGYUN/Abp/Demo/Books/BookAppService.cs index da1dd4a17..ab8e0fcc6 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application/LINGYUN/Abp/Demo/Books/BookAppService.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application/LINGYUN/Abp/Demo/Books/BookAppService.cs @@ -20,14 +20,14 @@ public class BookAppService : DemoApplicationServiceBase, IBookAppService //impl private readonly IAuthorRepository _authorRepository; private readonly AuthorManager _authorManager; - private readonly IExporterProvider _exporterProvider; - private readonly IImporterProvider _importerProvider; + private readonly IExcelExporterProvider _exporterProvider; + private readonly IExcelImporterProvider _importerProvider; protected IDataAccessEntityTypeInfoProvider EntityTypeInfoProvider => LazyServiceProvider.LazyGetRequiredService(); public BookAppService( - IExporterProvider exporterProvider, - IImporterProvider importerProvider, + IExcelExporterProvider exporterProvider, + IExcelImporterProvider importerProvider, IBookRepository bookRepository, AuthorManager authorManager, IAuthorRepository authorRepository) diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Authors/Author.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Authors/Author.cs index fdf137c2d..04f89a0a8 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Authors/Author.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Authors/Author.cs @@ -5,7 +5,7 @@ using Volo.Abp.Domain.Entities.Auditing; namespace LINGYUN.Abp.Demo.Authors; public class Author : FullAuditedAggregateRoot { - public string Name { get; private set; } + public string Name { get; private set; } = default!; public DateTime BirthDate { get; set; } public string? ShortBio { get; set; } diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Authors/IAuthorRepository.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Authors/IAuthorRepository.cs index d674c46dd..f6ae57c89 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Authors/IAuthorRepository.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Authors/IAuthorRepository.cs @@ -8,7 +8,7 @@ public interface IAuthorRepository : IRepository Task> GetListAsync( int skipCount, int maxResultCount, - string sorting, + string? sorting = nameof(Author.Name), string? filter = null ); } diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Books/Book.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Books/Book.cs index 79058bc2d..6130b8415 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Books/Book.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.Domain/LINGYUN/Abp/Demo/Books/Book.cs @@ -5,7 +5,7 @@ using Volo.Abp.Domain.Entities.Auditing; namespace LINGYUN.Abp.Demo.Books; public class Book : AuditedAggregateRoot, IDataProtected { - public string Name { get; set; } + public string Name { get; set; } = default!; public BookType Type { get; set; } diff --git a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.EntityFrameworkCore/LINGYUN/Abp/Demo/Authors/EfCoreAuthorRepository.cs b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.EntityFrameworkCore/LINGYUN/Abp/Demo/Authors/EfCoreAuthorRepository.cs index 0866258db..ff46f2387 100644 --- a/aspnet-core/modules/demo/LINGYUN.Abp.Demo.EntityFrameworkCore/LINGYUN/Abp/Demo/Authors/EfCoreAuthorRepository.cs +++ b/aspnet-core/modules/demo/LINGYUN.Abp.Demo.EntityFrameworkCore/LINGYUN/Abp/Demo/Authors/EfCoreAuthorRepository.cs @@ -24,7 +24,7 @@ public class EfCoreAuthorRepository public async Task> GetListAsync( int skipCount, int maxResultCount, - string sorting, + string? sorting = nameof(Author.Name), string? filter = null) { var dbSet = await GetDbSetAsync(); @@ -33,7 +33,7 @@ public class EfCoreAuthorRepository !filter.IsNullOrWhiteSpace(), author => author.Name.Contains(filter!) ) - .OrderBy(sorting) + .OrderBy(sorting.IsNullOrWhiteSpace() ? nameof(Author.Name) : sorting) .Skip(skipCount) .Take(maxResultCount) .ToListAsync(); diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN/Abp/Elsa/Activities/BlobStoring/Activities/BlobActivity.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN/Abp/Elsa/Activities/BlobStoring/Activities/BlobActivity.cs index bce3acfed..1b58d50a5 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN/Abp/Elsa/Activities/BlobStoring/Activities/BlobActivity.cs +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN/Abp/Elsa/Activities/BlobStoring/Activities/BlobActivity.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.Elsa.Activities.BlobStoring; public abstract class BlobActivity : AbpActivity { [ActivityInput(Hint = "Path of the blob.")] - public string Path { get; set; } + public string Path { get; set; } = default!; protected IBlobContainer BlobContainer; diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN/Abp/Elsa/Activities/BlobStoring/Activities/WriteBlob.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN/Abp/Elsa/Activities/BlobStoring/Activities/WriteBlob.cs index 11bdef347..9591fff1c 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN/Abp/Elsa/Activities/BlobStoring/Activities/WriteBlob.cs +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN/Abp/Elsa/Activities/BlobStoring/Activities/WriteBlob.cs @@ -21,7 +21,7 @@ public class WriteBlob : BlobActivity Hint = "The bytes to write.", SupportedSyntaxes = new[] { SyntaxNames.JavaScript }, DefaultSyntax = SyntaxNames.JavaScript)] - public byte[] Bytes { get; set; } + public byte[] Bytes { get; set; } = default!; public WriteBlob(IBlobContainer blobContainer) : base(blobContainer) diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/LINGYUN/Abp/Elsa/Activities/IM/Activities/SendMessage.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/LINGYUN/Abp/Elsa/Activities/IM/Activities/SendMessage.cs index c011fe078..d4770072a 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/LINGYUN/Abp/Elsa/Activities/IM/Activities/SendMessage.cs +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/LINGYUN/Abp/Elsa/Activities/IM/Activities/SendMessage.cs @@ -19,7 +19,7 @@ public class SendMessage : AbpActivity private readonly IMessageSender _messageSender; [ActivityInput(Hint = "The message content.")] - public string Content { get; set; } //TODO: Other message type + public string Content { get; set; } = default!; //TODO: Other message type [ActivityInput(Hint = "Source user identity.")] public Guid FormUser { get; set; } @@ -57,7 +57,7 @@ public class SendMessage : AbpActivity { chatMessage = ChatMessage.Group( FormUser, - FormUserName, + FormUserName!, GroupId, Content, _clock, @@ -70,7 +70,7 @@ public class SendMessage : AbpActivity { chatMessage = ChatMessage.User( FormUser, - FormUserName, + FormUserName!, To.Value, Content, _clock, diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/LINGYUN/Abp/Elsa/Activities/Notifications/Activities/SendNotification.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/LINGYUN/Abp/Elsa/Activities/Notifications/Activities/SendNotification.cs index 7e570da78..e215af27a 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/LINGYUN/Abp/Elsa/Activities/Notifications/Activities/SendNotification.cs +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/LINGYUN/Abp/Elsa/Activities/Notifications/Activities/SendNotification.cs @@ -22,7 +22,7 @@ public class SendNotification : AbpActivity private readonly INotificationSender _notificationSender; [ActivityInput(Hint = "The name of the registered notification.", SupportedSyntaxes = new[] { SyntaxNames.JavaScript, SyntaxNames.Liquid })] - public string NotificationName { get; set; } + public string NotificationName { get; set; } = default!; [ActivityInput( Hint = "Notifications pass data or template content.", @@ -30,7 +30,7 @@ public class SendNotification : AbpActivity SupportedSyntaxes = new[] { SyntaxNames.JavaScript, SyntaxNames.Liquid }, DefaultWorkflowStorageProvider = TransientWorkflowStorageProvider.ProviderName )] - public object NotificationData { get; set; } + public object NotificationData { get; set; } = default!; [ActivityInput( Hint = "The recipients user id list.", diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/LINGYUN/Abp/Elsa/Activities/Sms/Activities/SendSms.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/LINGYUN/Abp/Elsa/Activities/Sms/Activities/SendSms.cs index c2c2d3cc0..cc4094d47 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/LINGYUN/Abp/Elsa/Activities/Sms/Activities/SendSms.cs +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/LINGYUN/Abp/Elsa/Activities/Sms/Activities/SendSms.cs @@ -33,7 +33,7 @@ public class SendSms : AbpActivity public ICollection To { get; set; } = new List(); [ActivityInput(Hint = "The message content.")] - public string Message { get; set; } + public string Message { get; set; } = default!; [ActivityInput( Hint = "Attachment property that are sent with the message.", diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/LINGYUN/Abp/Elsa/Activities/Webhooks/Activities/PublishWebhook.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/LINGYUN/Abp/Elsa/Activities/Webhooks/Activities/PublishWebhook.cs index 466bd93ff..888713006 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/LINGYUN/Abp/Elsa/Activities/Webhooks/Activities/PublishWebhook.cs +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/LINGYUN/Abp/Elsa/Activities/Webhooks/Activities/PublishWebhook.cs @@ -23,7 +23,7 @@ public class PublishWebhook : AbpActivity [ActivityInput( Hint = "Unique name of the webhook.", SupportedSyntaxes = new[] { SyntaxNames.JavaScript, SyntaxNames.Liquid })] - public string WebhooName { get; set; } + public string WebhooName { get; set; } = default!; [ActivityInput( Hint = "Data to send.", @@ -31,7 +31,7 @@ public class PublishWebhook : AbpActivity SupportedSyntaxes = new[] { SyntaxNames.JavaScript, SyntaxNames.Liquid }, DefaultWorkflowStorageProvider = TransientWorkflowStorageProvider.ProviderName )] - public object WebhookData { get; set; } + public object WebhookData { get; set; } = default!; [ActivityInput( Hint = "If true, It sends the exact same data as the parameter to clients.", @@ -49,7 +49,7 @@ public class PublishWebhook : AbpActivity SupportedSyntaxes = new[] { SyntaxNames.Json, SyntaxNames.JavaScript, SyntaxNames.Liquid }, Category = PropertyCategories.Advanced )] - public IDictionary Headers { get; set; } + public IDictionary? Headers { get; set; } public PublishWebhook( IWebhookPublisher webhookPublisher) @@ -68,7 +68,7 @@ public class PublishWebhook : AbpActivity new WebhookHeader { UseOnlyGivenHeaders = UseOnlyGivenHeaders, - Headers = Headers + Headers = Headers ?? new Dictionary() }); return Done(); diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN/Abp/Elsa/Notifications/AbpElsaWorkflowNotificationHandler.cs b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN/Abp/Elsa/Notifications/AbpElsaWorkflowNotificationHandler.cs index 8ae8b88df..c31751ded 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN/Abp/Elsa/Notifications/AbpElsaWorkflowNotificationHandler.cs +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN/Abp/Elsa/Notifications/AbpElsaWorkflowNotificationHandler.cs @@ -53,7 +53,7 @@ public class AbpElsaWorkflowNotificationHandler : } private async Task SendNotifierIfExistsAsync( - string notificationName, + string? notificationName, WorkflowExecutionContext executionContext, NotificationSeverity severity = NotificationSeverity.Info, CancellationToken cancellationToken = default) @@ -72,7 +72,7 @@ public class AbpElsaWorkflowNotificationHandler : var currentTenant = serviceProvider.GetRequiredService(); var notificationSender = serviceProvider.GetRequiredService(); - var notificationData = new Dictionary + var notificationData = new Dictionary { { nameof(IActivityBlueprint.Id), workflowBlueprint.Id }, { nameof(WorkflowExecutionContext.Status), executionContext.Status }, diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionCreateDto.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionCreateDto.cs index 8eba14954..56a954943 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionCreateDto.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionCreateDto.cs @@ -8,9 +8,9 @@ public class FeatureDefinitionCreateDto : FeatureDefinitionCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(FeatureDefinitionRecordConsts), nameof(FeatureDefinitionRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] [DynamicStringLength(typeof(FeatureGroupDefinitionRecordConsts), nameof(FeatureGroupDefinitionRecordConsts.MaxNameLength))] - public string GroupName { get; set; } + public string GroupName { get; set; } = default!; } diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionCreateOrUpdateDto.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionCreateOrUpdateDto.cs index 6cd27fab2..dd99b222a 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionCreateOrUpdateDto.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionCreateOrUpdateDto.cs @@ -10,16 +10,16 @@ public abstract class FeatureDefinitionCreateOrUpdateDto : IHasExtraProperties { [Required] [DynamicStringLength(typeof(FeatureDefinitionRecordConsts), nameof(FeatureDefinitionRecordConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(FeatureDefinitionRecordConsts), nameof(FeatureDefinitionRecordConsts.MaxNameLength))] - public string ParentName { get; set; } + public string? ParentName { get; set; } [DynamicStringLength(typeof(FeatureDefinitionRecordConsts), nameof(FeatureDefinitionRecordConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } [DynamicStringLength(typeof(FeatureDefinitionRecordConsts), nameof(FeatureDefinitionRecordConsts.MaxDefaultValueLength))] - public string DefaultValue { get; set; } + public string? DefaultValue { get; set; } public bool IsVisibleToClients { get; set; } @@ -29,7 +29,7 @@ public abstract class FeatureDefinitionCreateOrUpdateDto : IHasExtraProperties [Required] [DynamicStringLength(typeof(FeatureDefinitionRecordConsts), nameof(FeatureDefinitionRecordConsts.MaxValueTypeLength))] - public string ValueType { get; set; } + public string ValueType { get; set; } = default!; public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary(); } diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionDto.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionDto.cs index d45d22299..f8b391c07 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionDto.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionDto.cs @@ -5,17 +5,17 @@ namespace LINGYUN.Abp.FeatureManagement.Definitions; public class FeatureDefinitionDto : IHasExtraProperties { - public string GroupName { get; set; } + public string GroupName { get; set; } = default!; - public string Name { get; set; } + public string Name { get; set; } = default!; - public string ParentName { get; set; } + public string? ParentName { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; - public string Description { get; set; } + public string? Description { get; set; } - public string DefaultValue { get; set; } + public string? DefaultValue { get; set; } public bool IsVisibleToClients { get; set; } @@ -25,7 +25,7 @@ public class FeatureDefinitionDto : IHasExtraProperties public List AllowedProviders { get; set; } = new List(); - public string ValueType { get; set; } + public string ValueType { get; set; } = default!; public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary(); } diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionGetListInput.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionGetListInput.cs index c76ed2eec..237ac1afd 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionGetListInput.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionGetListInput.cs @@ -1,7 +1,7 @@ namespace LINGYUN.Abp.FeatureManagement.Definitions; public class FeatureDefinitionGetListInput { - public string Filter { get; set; } + public string? Filter { get; set; } - public string GroupName { get; set; } + public string? GroupName { get; set; } } diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionUpdateDto.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionUpdateDto.cs index 9be0e4b3e..061d1030a 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionUpdateDto.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureDefinitionUpdateDto.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.FeatureManagement.Definitions; public class FeatureDefinitionUpdateDto : FeatureDefinitionCreateOrUpdateDto, IHasConcurrencyStamp { [StringLength(40)] - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionCreateDto.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionCreateDto.cs index 1b465d53e..3501ee377 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionCreateDto.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionCreateDto.cs @@ -7,5 +7,5 @@ public class FeatureGroupDefinitionCreateDto : FeatureGroupDefinitionCreateOrUpd { [Required] [DynamicStringLength(typeof(FeatureGroupDefinitionRecordConsts), nameof(FeatureGroupDefinitionRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionCreateOrUpdateDto.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionCreateOrUpdateDto.cs index 67cdb9794..5d049699b 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionCreateOrUpdateDto.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionCreateOrUpdateDto.cs @@ -9,7 +9,7 @@ public abstract class FeatureGroupDefinitionCreateOrUpdateDto : IHasExtraPropert { [Required] [DynamicStringLength(typeof(FeatureGroupDefinitionRecordConsts), nameof(FeatureGroupDefinitionRecordConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary(); } diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionDto.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionDto.cs index 765d98ba9..e43080c6b 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionDto.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionDto.cs @@ -4,11 +4,11 @@ namespace LINGYUN.Abp.FeatureManagement.Definitions; public class FeatureGroupDefinitionDto : IHasExtraProperties { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public bool IsStatic { get; set; } - public ExtraPropertyDictionary ExtraProperties { get; set; } + public ExtraPropertyDictionary ExtraProperties { get; set; } = default!; } diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionGetListInput.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionGetListInput.cs index d29974b3a..b51735acb 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionGetListInput.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionGetListInput.cs @@ -1,5 +1,5 @@ namespace LINGYUN.Abp.FeatureManagement.Definitions; public class FeatureGroupDefinitionGetListInput { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionUpdateDto.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionUpdateDto.cs index dafa11775..5a09180a4 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionUpdateDto.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN/Abp/FeatureManagement/Definitions/Dto/FeatureGroupDefinitionUpdateDto.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.FeatureManagement.Definitions; public class FeatureGroupDefinitionUpdateDto : FeatureGroupDefinitionCreateOrUpdateDto, IHasConcurrencyStamp { [StringLength(40)] - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureDefinitionAppService.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureDefinitionAppService.cs index ffba2e2c4..349079347 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureDefinitionAppService.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureDefinitionAppService.cs @@ -87,7 +87,7 @@ public class FeatureDefinitionAppService : FeatureManagementAppServiceBase, IFea await _definitionRepository.InsertAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(definitionRecord); } @@ -103,7 +103,7 @@ public class FeatureDefinitionAppService : FeatureManagementAppServiceBase, IFea await _definitionRepository.DeleteAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(string name) @@ -140,7 +140,7 @@ public class FeatureDefinitionAppService : FeatureManagementAppServiceBase, IFea UpdateByInput(definitionRecord, input); definitionRecord = await _definitionBasicRepository.UpdateAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(definitionRecord); } @@ -174,7 +174,7 @@ public class FeatureDefinitionAppService : FeatureManagementAppServiceBase, IFea { record.DefaultValue = input.DefaultValue; } - string allowedProviders = null; + string? allowedProviders = null; if (!input.AllowedProviders.IsNullOrEmpty()) { allowedProviders = input.AllowedProviders.JoinAsString(","); @@ -208,7 +208,7 @@ public class FeatureDefinitionAppService : FeatureManagementAppServiceBase, IFea } } - protected async virtual Task FindRecordByNameAsync(string name) + protected async virtual Task FindRecordByNameAsync(string name) { var DefinitionFilter = await _definitionBasicRepository.GetQueryableAsync(); diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureGroupDefinitionAppService.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureGroupDefinitionAppService.cs index ec0d54d52..d5cb16b55 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureGroupDefinitionAppService.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN/Abp/FeatureManagement/Definitions/FeatureGroupDefinitionAppService.cs @@ -49,7 +49,7 @@ public class FeatureGroupDefinitionAppService : FeatureManagementAppServiceBase, await _groupDefinitionRepository.InsertAsync(groupDefinitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return GroupDefinitionRecordToDto(groupDefinitionRecord); } @@ -65,7 +65,7 @@ public class FeatureGroupDefinitionAppService : FeatureManagementAppServiceBase, await _groupDefinitionRepository.DeleteAsync(groupDefinitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(string name) @@ -104,7 +104,7 @@ public class FeatureGroupDefinitionAppService : FeatureManagementAppServiceBase, UpdateByInput(groupDefinitionRecord, input); groupDefinitionRecord = await _groupDefinitionBasicRepository.UpdateAsync(groupDefinitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return GroupDefinitionRecordToDto(groupDefinitionRecord); } @@ -131,7 +131,7 @@ public class FeatureGroupDefinitionAppService : FeatureManagementAppServiceBase, } } - protected async virtual Task FindByNameAsync(string name) + protected async virtual Task FindByNameAsync(string name) { var groupDefinitionRecord = await _groupDefinitionBasicRepository.FindAsync(x => x.Name == name); diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/Volo/Abp/Features/FeatureGroupDefinitionExtensions.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/Volo/Abp/Features/FeatureGroupDefinitionExtensions.cs index d712d9c48..5b9c208f6 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/Volo/Abp/Features/FeatureGroupDefinitionExtensions.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/Volo/Abp/Features/FeatureGroupDefinitionExtensions.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; namespace Volo.Abp.Features; public static class FeatureGroupDefinitionExtensions { - public static FeatureDefinition GetFeatureOrNull( + public static FeatureDefinition? GetFeatureOrNull( this FeatureGroupDefinition group, [NotNull] string name) { @@ -13,7 +13,7 @@ public static class FeatureGroupDefinitionExtensions return GetFeatureOrNullRecursively(group.Features, name); } - private static FeatureDefinition GetFeatureOrNullRecursively( + private static FeatureDefinition? GetFeatureOrNullRecursively( IReadOnlyList features, string name) { diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/Volo/Abp/Features/IFeatureDefinitionManagerExtensions.cs b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/Volo/Abp/Features/IFeatureDefinitionManagerExtensions.cs index c19f8f8d0..44389d1ef 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/Volo/Abp/Features/IFeatureDefinitionManagerExtensions.cs +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/Volo/Abp/Features/IFeatureDefinitionManagerExtensions.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; namespace Volo.Abp.Features; public static class IPermissionDefinitionManagerExtensions { - public async static Task GetGroupOrNullAsync( + public async static Task GetGroupOrNullAsync( this IFeatureDefinitionManager featureDefinitionManager, string name ) diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoCacheItem.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoCacheItem.cs index 0e01889e8..5ce85a62c 100644 --- a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoCacheItem.cs +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoCacheItem.cs @@ -2,8 +2,8 @@ public class GdprInfoCacheItem { - public string Data { get; set; } - public string Provider { get; set; } + public string Data { get; set; } = default!; + public string Provider { get; set; } = default!; public GdprInfoCacheItem() { diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprInfo.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprInfo.cs index a300ddc11..ed6e4ffc2 100644 --- a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprInfo.cs +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprInfo.cs @@ -18,12 +18,12 @@ public class GdprInfo : Entity /// /// 用于存储个人数据 /// - public virtual string Data { get; protected set; } + public virtual string Data { get; protected set; } = default!; /// /// 表示收集个人数据的模块 /// - public virtual string Provider { get; protected set; } + public virtual string Provider { get; protected set; } = default!; protected GdprInfo() { diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/AbpGdprWebModule.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/AbpGdprWebModule.cs index efae4e8b6..f1fd99c79 100644 --- a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/AbpGdprWebModule.cs +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/AbpGdprWebModule.cs @@ -62,14 +62,14 @@ public class AbpGdprWebModule : AbpModule Configure(options => { options.ScriptBundles - .Configure(typeof(ManageModel).FullName, + .Configure(typeof(ManageModel).FullName!, configuration => { configuration.AddFiles("/client-proxies/gdpr-proxy.js"); configuration.AddFiles("/Pages/Account/Components/ProfileManagementGroup/Gdpr/Index.js"); }); options.ScriptBundles - .Configure(typeof(DeleteModel).FullName, + .Configure(typeof(DeleteModel).FullName!, configuration => { configuration.AddFiles("/client-proxies/gdpr-proxy.js"); diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Delete.cshtml.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Delete.cshtml.cs index 3b6dd610a..39478a671 100644 --- a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Delete.cshtml.cs +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Web/Pages/Account/Delete.cshtml.cs @@ -10,7 +10,7 @@ public class DeleteModel : AccountPageModel { [HiddenInput] [BindProperty(SupportsGet = true)] - public string ReturnUrl { get; set; } + public string? ReturnUrl { get; set; } public DeleteModel() { diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/GetUserSessionsInput.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/GetUserSessionsInput.cs index c595dfd43..ab9abbe2f 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/GetUserSessionsInput.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/GetUserSessionsInput.cs @@ -11,9 +11,9 @@ public class GetUserSessionsInput : PagedAndSortedResultRequestDto /// /// 设备 /// - public string Device { get; set; } + public string? Device { get; set; } /// /// 客户端id /// - public string ClientId { get; set; } + public string? ClientId { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimDto.cs index b82dccf36..84ff32367 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimDto.cs @@ -5,7 +5,7 @@ namespace LINGYUN.Abp.Identity; public class IdentityClaimDto : EntityDto { - public string ClaimType { get; set; } + public string ClaimType { get; set; } = default!; - public string ClaimValue { get; set; } + public string? ClaimValue { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateDto.cs index a3566f72b..2b143e724 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateDto.cs @@ -8,7 +8,7 @@ public class IdentityClaimTypeCreateDto : IdentityClaimTypeCreateOrUpdateBaseDto { [Required] [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; public bool IsStatic { get; set; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateOrUpdateBaseDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateOrUpdateBaseDto.cs index b6113c930..f5d261c43 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateOrUpdateBaseDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateOrUpdateBaseDto.cs @@ -9,13 +9,13 @@ public class IdentityClaimTypeCreateOrUpdateBaseDto : ExtensibleObject public bool Required { get; set; } [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxRegexLength))] - public string Regex { get; set; } + public string? Regex { get; set; } [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxRegexDescriptionLength))] - public string RegexDescription { get; set; } + public string? RegexDescription { get; set; } [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeDto.cs index 467e72f51..6b2fe09dd 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeDto.cs @@ -6,17 +6,17 @@ namespace LINGYUN.Abp.Identity; public class IdentityClaimTypeDto : ExtensibleEntityDto { - public string Name { get; set; } + public string Name { get; set; } = default!; public bool Required { get; set; } public bool IsStatic { get; set; } - public string Regex { get; set; } + public string? Regex { get; set; } - public string RegexDescription { get; set; } + public string? RegexDescription { get; set; } - public string Description { get; set; } + public string? Description { get; set; } public IdentityClaimValueType ValueType { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeGetByPagedDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeGetByPagedDto.cs index 66e788f11..b25f55275 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeGetByPagedDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeGetByPagedDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.Identity; public class IdentityClaimTypeGetByPagedDto : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleAddOrRemoveOrganizationUnitDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleAddOrRemoveOrganizationUnitDto.cs index bda085d14..255c3a946 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleAddOrRemoveOrganizationUnitDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleAddOrRemoveOrganizationUnitDto.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.Identity; public class IdentityRoleAddOrRemoveOrganizationUnitDto { [Required] - public Guid[] OrganizationUnitIds { get; set; } + public Guid[] OrganizationUnitIds { get; set; } = default!; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimCreateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimCreateDto.cs index 639d0cc04..adcdb7d9f 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimCreateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimCreateDto.cs @@ -8,9 +8,9 @@ public class IdentityRoleClaimCreateDto { [Required] [DynamicMaxLength(typeof(IdentityRoleClaimConsts), nameof(IdentityRoleClaimConsts.MaxClaimTypeLength))] - public string ClaimType { get; set; } + public string ClaimType { get; set; } = default!; [Required] [DynamicMaxLength(typeof(IdentityRoleClaimConsts), nameof(IdentityRoleClaimConsts.MaxClaimValueLength))] - public string ClaimValue { get; set; } + public string ClaimValue { get; set; } = default!; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimUpdateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimUpdateDto.cs index 60f1754e0..152778206 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimUpdateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimUpdateDto.cs @@ -8,5 +8,5 @@ public class IdentityRoleClaimUpdateDto : IdentityRoleClaimCreateDto { [Required] [DynamicMaxLength(typeof(IdentityRoleClaimConsts), nameof(IdentityRoleClaimConsts.MaxClaimValueLength))] - public string NewClaimValue { get; set; } + public string NewClaimValue { get; set; } = default!; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentitySessionDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentitySessionDto.cs index da79e346a..19df67cb9 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentitySessionDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentitySessionDto.cs @@ -4,17 +4,17 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.Identity; public class IdentitySessionDto : ExtensibleEntityDto { - public string SessionId { get; set; } + public string SessionId { get; set; } = default!; - public string Device { get; set; } + public string? Device { get; set; } - public string DeviceInfo { get; set; } + public string? DeviceInfo { get; set; } public Guid UserId { get; set; } - public string ClientId { get; set; } + public string? ClientId { get; set; } - public string IpAddresses { get; set; } + public string? IpAddresses { get; set; } public DateTime SignedIn { get; set; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateOrUpdateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateOrUpdateDto.cs index ded7a71be..8f93440f4 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateOrUpdateDto.cs @@ -8,8 +8,9 @@ public abstract class IdentityUserClaimCreateOrUpdateDto { [Required] [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimTypeLength))] - public string ClaimType { get; set; } + public string ClaimType { get; set; } = default!; + [Required] [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] - public string ClaimValue { get; set; } + public string ClaimValue { get; set; } = default!; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimUpdateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimUpdateDto.cs index 9210b103d..722665c55 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimUpdateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimUpdateDto.cs @@ -1,10 +1,12 @@ -using Volo.Abp.Identity; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Identity; using Volo.Abp.Validation; namespace LINGYUN.Abp.Identity; public class IdentityUserClaimUpdateDto : IdentityUserClaimCreateOrUpdateDto { + [Required] [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] - public string NewClaimValue { get; set; } + public string NewClaimValue { get; set; } = default!; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserOrganizationUnitUpdateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserOrganizationUnitUpdateDto.cs index 57118f7d8..810d89574 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserOrganizationUnitUpdateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserOrganizationUnitUpdateDto.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.Identity; public class IdentityUserOrganizationUnitUpdateDto { [Required] - public Guid[] OrganizationUnitIds { get; set; } + public Guid[] OrganizationUnitIds { get; set; } = default!; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserSetPasswordInput.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserSetPasswordInput.cs index 8fcb47e69..3d3a8719a 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserSetPasswordInput.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserSetPasswordInput.cs @@ -10,5 +10,5 @@ public class IdentityUserSetPasswordInput [Required] [DisableAuditing] [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] - public string Password { get; set; } + public string Password { get; set; } = default!; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddRoleDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddRoleDto.cs index dfc5590a6..4a23945a1 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddRoleDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddRoleDto.cs @@ -7,5 +7,5 @@ namespace LINGYUN.Abp.Identity; public class OrganizationUnitAddRoleDto { [Required] - public List RoleIds { get; set; } + public List RoleIds { get; set; } = default!; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddUserDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddUserDto.cs index 829b177ce..55f069fe8 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddUserDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddUserDto.cs @@ -7,5 +7,5 @@ namespace LINGYUN.Abp.Identity; public class OrganizationUnitAddUserDto { [Required] - public List UserIds { get; set; } + public List UserIds { get; set; } = default!; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitCreateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitCreateDto.cs index fb95f7f59..84f76217c 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitCreateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitCreateDto.cs @@ -10,7 +10,7 @@ public class OrganizationUnitCreateDto : ExtensibleObject { [Required] [DynamicStringLength(typeof(OrganizationUnitConsts), nameof(OrganizationUnitConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public Guid? ParentId { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDto.cs index d0257bf28..f3063bab8 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDto.cs @@ -6,6 +6,6 @@ namespace LINGYUN.Abp.Identity; public class OrganizationUnitDto : ExtensibleAuditedEntityDto { public Guid? ParentId { get; set; } - public string Code { get; set; } - public string DisplayName { get; set; } + public string? Code { get; set; } + public string? DisplayName { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetByPagedDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetByPagedDto.cs index f41dff98a..20319fb26 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetByPagedDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetByPagedDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.Identity; public class OrganizationUnitGetByPagedDto : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedRoleByPagedDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedRoleByPagedDto.cs index d030b9e8a..ea8f4e8fb 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedRoleByPagedDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedRoleByPagedDto.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.Identity; public class OrganizationUnitGetUnaddedRoleByPagedDto : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedUserByPagedDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedUserByPagedDto.cs index 3c77c9754..2123fc22f 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedUserByPagedDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedUserByPagedDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.Identity; public class OrganizationUnitGetUnaddedUserByPagedDto : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitUpdateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitUpdateDto.cs index 6c55186dd..7c6415fac 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitUpdateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitUpdateDto.cs @@ -1,8 +1,11 @@ -using Volo.Abp.ObjectExtending; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Validation; namespace LINGYUN.Abp.Identity; public class OrganizationUnitUpdateDto : ExtensibleObject { - public string DisplayName { get; set; } + [DynamicStringLength(typeof(OrganizationUnitConsts), nameof(OrganizationUnitConsts.MaxDisplayNameLength))] + public string? DisplayName { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityClaimTypeAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityClaimTypeAppService.cs index 5504bd531..8f8351499 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityClaimTypeAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityClaimTypeAppService.cs @@ -41,7 +41,7 @@ public class IdentityClaimTypeAppService : IdentityAppServiceBase, IIdentityClai input.ValueType ); identityClaimType = await IdentityClaimTypeManager.CreateAsync(identityClaimType); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(identityClaimType); } @@ -49,18 +49,14 @@ public class IdentityClaimTypeAppService : IdentityAppServiceBase, IIdentityClai [Authorize(IdentityPermissions.IdentityClaimType.Delete)] public async virtual Task DeleteAsync(Guid id) { - var identityClaimType = await IdentityClaimTypeRepository.FindAsync(id); - if (identityClaimType == null) - { - return; - } + var identityClaimType = await IdentityClaimTypeRepository.GetAsync(id); CheckDeletionClaimType(identityClaimType); await IdentityClaimTypeRepository.DeleteAsync(identityClaimType); } public async virtual Task GetAsync(Guid id) { - var identityClaimType = await IdentityClaimTypeRepository.FindAsync(id); + var identityClaimType = await IdentityClaimTypeRepository.GetAsync(id); return ObjectMapper.Map(identityClaimType); } @@ -105,7 +101,7 @@ public class IdentityClaimTypeAppService : IdentityAppServiceBase, IIdentityClai } identityClaimType = await IdentityClaimTypeManager.UpdateAsync(identityClaimType); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(identityClaimType); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityRoleAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityRoleAppService.cs index 4df4ff583..dc2d41aed 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityRoleAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityRoleAppService.cs @@ -15,7 +15,6 @@ public class IdentityRoleAppService : IdentityAppServiceBase, IIdentityRoleAppSe { protected IIdentityRoleRepository IdentityRoleRepository { get; } protected OrganizationUnitManager OrganizationUnitManager { get; } - protected IOrganizationUnitRepository OrganizationUnitRepository { get; } public IdentityRoleAppService( IIdentityRoleRepository roleRepository, OrganizationUnitManager organizationUnitManager) @@ -53,7 +52,7 @@ public class IdentityRoleAppService : IdentityAppServiceBase, IIdentityRoleAppSe origanzationUnit.RemoveRole(id); } - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(IdentityPermissions.Roles.ManageOrganizationUnits)] @@ -61,7 +60,7 @@ public class IdentityRoleAppService : IdentityAppServiceBase, IIdentityRoleAppSe { await OrganizationUnitManager.RemoveRoleFromOrganizationUnitAsync(id, ouId); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } #endregion @@ -88,7 +87,7 @@ public class IdentityRoleAppService : IdentityAppServiceBase, IIdentityRoleAppSe role.AddClaim(GuidGenerator, claim); await IdentityRoleRepository.UpdateAsync(role); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(IdentityPermissions.Roles.ManageClaims)] @@ -103,7 +102,7 @@ public class IdentityRoleAppService : IdentityAppServiceBase, IIdentityRoleAppSe await IdentityRoleRepository.UpdateAsync(role); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } } @@ -115,7 +114,7 @@ public class IdentityRoleAppService : IdentityAppServiceBase, IIdentityRoleAppSe await IdentityRoleRepository.UpdateAsync(role); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } #endregion diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityUserAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityUserAppService.cs index 4d9d66151..8696ad90d 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityUserAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityUserAppService.cs @@ -44,7 +44,7 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe await UserManager.SetOrganizationUnitsAsync(user, input.OrganizationUnitIds); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(IdentityPermissions.Users.ManageOrganizationUnits)] @@ -52,7 +52,7 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe { await UserManager.RemoveFromOrganizationUnitAsync(id, ouId); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } #endregion @@ -78,7 +78,7 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe user.AddClaim(GuidGenerator, claim); (await UserManager.UpdateAsync(user)).CheckErrors(); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(IdentityPermissions.Users.ManageClaims)] @@ -90,7 +90,7 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe user.ReplaceClaim(oldClaim, newClaim); (await UserManager.UpdateAsync(user)).CheckErrors(); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(IdentityPermissions.Users.ManageClaims)] @@ -100,7 +100,7 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe user.RemoveClaim(new Claim(input.ClaimType, input.ClaimValue)); (await UserManager.UpdateAsync(user)).CheckErrors(); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } #endregion @@ -128,7 +128,7 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe (await UserManager.ResetPasswordAsync(user, token, input.Password)).CheckErrors(); } - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Update)] @@ -138,7 +138,7 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe (await UserManager.SetTwoFactorEnabledWithAccountConfirmedAsync(user, input.Enabled)).CheckErrors(); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } #endregion @@ -156,7 +156,7 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe var endDate = new DateTimeOffset(Clock.Now).AddSeconds(seconds); (await UserManager.SetLockoutEndDateAsync(user, endDate)).CheckErrors(); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Update)] @@ -165,7 +165,7 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe var user = await GetUserAsync(id); (await UserManager.SetLockoutEndDateAsync(user, null)).CheckErrors(); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } #endregion diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs index 6a5882e3e..1ee706e47 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs @@ -46,7 +46,7 @@ public class OrganizationUnitAppService : IdentityAppServiceBase, IOrganizationU input.MapExtraPropertiesTo(origanizationUnit); await OrganizationUnitManager.CreateAsync(origanizationUnit); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(origanizationUnit); } @@ -80,7 +80,7 @@ public class OrganizationUnitAppService : IdentityAppServiceBase, IOrganizationU public async virtual Task GetAsync(Guid id) { - var origanizationUnit = await OrganizationUnitRepository.FindAsync(id); + var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); return ObjectMapper.Map(origanizationUnit); } @@ -195,7 +195,7 @@ public class OrganizationUnitAppService : IdentityAppServiceBase, IOrganizationU input.MapExtraPropertiesTo(origanizationUnit); await OrganizationUnitManager.UpdateAsync(origanizationUnit); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(origanizationUnit); } @@ -212,7 +212,7 @@ public class OrganizationUnitAppService : IdentityAppServiceBase, IOrganizationU await UserManager.AddToOrganizationUnitAsync(user, origanizationUnit); } - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(IdentityPermissions.OrganizationUnits.ManageRoles)] @@ -227,6 +227,6 @@ public class OrganizationUnitAppService : IdentityAppServiceBase, IOrganizationU await OrganizationUnitManager.AddRoleToOrganizationUnitAsync(role, origanizationUnit); } - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitGetListSpecification.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitGetListSpecification.cs index e9a45cbc6..92fb1046b 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitGetListSpecification.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitGetListSpecification.cs @@ -18,6 +18,6 @@ public class OrganizationUnitGetListSpecification : Specification - x.DisplayName.Contains(Input.Filter) || x.Code.Contains(Input.Filter)); + x.DisplayName.Contains(Input.Filter!) || x.Code.Contains(Input.Filter!)); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN/Abp/Identity/AspNetCore/Session/AbpIdentitySessionAuthenticationService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN/Abp/Identity/AspNetCore/Session/AbpIdentitySessionAuthenticationService.cs index 6141f7859..3c85e0feb 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN/Abp/Identity/AspNetCore/Session/AbpIdentitySessionAuthenticationService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN/Abp/Identity/AspNetCore/Session/AbpIdentitySessionAuthenticationService.cs @@ -26,20 +26,23 @@ public class AbpIdentitySessionAuthenticationService : AuthenticationService IdentitySessionManager = identitySessionManager; } - public async override Task SignInAsync(HttpContext context, string scheme, ClaimsPrincipal principal, AuthenticationProperties properties) + public async override Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties) { await base.SignInAsync(context, scheme, principal, properties); - if (SessionSignInOptions.SignInSessionEnabled && SessionSignInOptions.AuthenticationSchemes.Contains(scheme)) + if (SessionSignInOptions.SignInSessionEnabled && + !scheme.IsNullOrWhiteSpace() && + SessionSignInOptions.AuthenticationSchemes.Contains(scheme)) { // Save the user session. await IdentitySessionManager.SaveSessionAsync(principal); } } - public async override Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties) + public async override Task SignOutAsync(HttpContext context, string? scheme, AuthenticationProperties? properties) { if (SessionSignInOptions.SignOutSessionEnabled && + !scheme.IsNullOrWhiteSpace() && SessionSignInOptions.AuthenticationSchemes.Contains(scheme)) { var sessionId = context.User?.FindSessionId(); diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityException.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityException.cs index f0cb99a9f..5116fae66 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityException.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityException.cs @@ -9,10 +9,10 @@ namespace LINGYUN.Abp.Identity; public class IdentityException : BusinessException, IExceptionWithSelfLogging { public IdentityException( - string code = null, - string message = null, - string details = null, - Exception innerException = null, + string? code = null, + string? message = null, + string? details = null, + Exception? innerException = null, LogLevel logLevel = LogLevel.Warning) : base(code, message, details, innerException, logLevel) { diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentitySessionEto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentitySessionEto.cs index 1af919c54..6a5af5154 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentitySessionEto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentitySessionEto.cs @@ -11,17 +11,17 @@ public class IdentitySessionEto : EtoBase, IMultiTenant public Guid? TenantId { get; set; } - public string SessionId { get; set; } + public string SessionId { get; set; } = default!; - public string Device { get; set; } + public string Device { get; set; } = default!; - public string DeviceInfo { get; set; } + public string? DeviceInfo { get; set; } public Guid UserId { get; set; } - public string ClientId { get; set; } + public string? ClientId { get; set; } - public string IpAddresses { get; set; } + public string? IpAddresses { get; set; } public DateTime SignedIn { get; set; } @@ -34,10 +34,10 @@ public class IdentitySessionEto : EtoBase, IMultiTenant Guid id, string sessionId, string device, - string deviceInfo, + string? deviceInfo, Guid userId, - string clientId, - string ipAddresses, + string? clientId, + string? ipAddresses, DateTime signedIn, DateTime? lastAccessed, Guid? tenantId = null) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityUserSessionPasswordChangedEto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityUserSessionPasswordChangedEto.cs index 3443af2c8..45bea1e5a 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityUserSessionPasswordChangedEto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityUserSessionPasswordChangedEto.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.Identity; [Serializable] public class IdentityUserSessionPasswordChangedEto : IdentityUserPasswordChangedEto { - public string SessionId { get; set; } + public string? SessionId { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/DefaultUserPictureProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/DefaultUserPictureProvider.cs index 9f12bdf22..1466bd088 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/DefaultUserPictureProvider.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/DefaultUserPictureProvider.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Abp.Identity; [Dependency(TryRegister = true)] public class DefaultUserPictureProvider : IUserPictureProvider, ISingletonDependency { - public Task SetPictureAsync(IdentityUser user, Stream stream, string fileName = null) + public Task SetPictureAsync(IdentityUser user, Stream stream, string? fileName = null) { return Task.CompletedTask; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentitySessionRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentitySessionRepository.cs index 5b0e04d51..587470777 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentitySessionRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentitySessionRepository.cs @@ -8,14 +8,14 @@ using Volo.Abp.Specifications; namespace LINGYUN.Abp.Identity; public interface IIdentitySessionRepository : Volo.Abp.Identity.IIdentitySessionRepository { - Task FindLastAsync( + Task FindLastAsync( Guid userId, - string device = null, + string? device = null, CancellationToken cancellationToken = default); Task> GetListAsync( Guid userId, - string device, + string? device = null, Guid? exceptSessionId = null, int maxResultCount = 0, CancellationToken cancellationToken = default); @@ -30,7 +30,7 @@ public interface IIdentitySessionRepository : Volo.Abp.Identity.IIdentitySession Task> GetListAsync( ISpecification specification, - string sorting = $"{nameof(IdentitySession.SignedIn)} DESC", + string? sorting = $"{nameof(IdentitySession.SignedIn)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserInactiveRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserInactiveRepository.cs index dff07624d..35dc26b29 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserInactiveRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserInactiveRepository.cs @@ -10,19 +10,19 @@ namespace LINGYUN.Abp.Identity; public interface IIdentityUserInactiveRepository : IBasicRepository { - Task FindByUserIdAsync( + Task FindByUserIdAsync( Guid userId, CancellationToken cancellationToken = default); Task GetInactiveUserCountAsync( DateTime threshold, - IEnumerable exceptUserIds = null, + IEnumerable? exceptUserIds = null, CancellationToken cancellationToken = default); Task> GetInactiveUserListAsync( DateTime threshold, - IEnumerable exceptUserIds = null, - string sorting = nameof(IdentityUser.LastSignInTime), + IEnumerable? exceptUserIds = null, + string? sorting = nameof(IdentityUser.LastSignInTime), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); @@ -33,7 +33,7 @@ public interface IIdentityUserInactiveRepository : IBasicRepository> GetListAsync( ISpecification specification, - string sorting = nameof(IdentityUserInactive.CreationTime), + string? sorting = nameof(IdentityUserInactive.CreationTime), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserRepository.cs index 35bf82c92..89d486d75 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserRepository.cs @@ -43,7 +43,7 @@ public interface IIdentityUserRepository : Volo.Abp.Identity.IIdentityUserReposi /// /// /// - Task FindByPhoneNumberAsync( + Task FindByPhoneNumberAsync( string phoneNumber, bool isConfirmed = true, bool includeDetails = false, @@ -72,7 +72,7 @@ public interface IIdentityUserRepository : Volo.Abp.Identity.IIdentityUserReposi /// Task> GetOrganizationUnitsAsync( Guid userId, - string filter = null, + string? filter = null, bool includeDetails = false, int skipCount = 1, int maxResultCount = 10, @@ -87,13 +87,13 @@ public interface IIdentityUserRepository : Volo.Abp.Identity.IIdentityUserReposi /// Task GetUsersInOrganizationUnitCountAsync( Guid organizationUnitId, - string filter = null, + string? filter = null, CancellationToken cancellationToken = default ); Task> GetUsersInOrganizationUnitAsync( Guid organizationUnitId, - string filter = null, + string? filter = null, int skipCount = 1, int maxResultCount = 10, CancellationToken cancellationToken = default @@ -101,13 +101,13 @@ public interface IIdentityUserRepository : Volo.Abp.Identity.IIdentityUserReposi Task GetUsersInOrganizationsListCountAsync( List organizationUnitIds, - string filter = null, + string? filter = null, CancellationToken cancellationToken = default ); Task> GetUsersInOrganizationsListAsync( List organizationUnitIds, - string filter = null, + string? filter = null, int skipCount = 1, int maxResultCount = 10, CancellationToken cancellationToken = default @@ -115,13 +115,13 @@ public interface IIdentityUserRepository : Volo.Abp.Identity.IIdentityUserReposi Task GetUsersInOrganizationUnitWithChildrenCountAsync( string code, - string filter = null, + string? filter = null, CancellationToken cancellationToken = default ); Task> GetUsersInOrganizationUnitWithChildrenAsync( string code, - string filter = null, + string? filter = null, int skipCount = 1, int maxResultCount = 10, CancellationToken cancellationToken = default diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IOrganizationUnitRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IOrganizationUnitRepository.cs index 5a15c6bc6..3f2af562f 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IOrganizationUnitRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IOrganizationUnitRepository.cs @@ -14,7 +14,7 @@ public interface IOrganizationUnitRepository : Volo.Abp.Identity.IOrganizationUn Task> GetListAsync( ISpecification specification, - string sorting = nameof(OrganizationUnit.Code), + string? sorting = nameof(OrganizationUnit.Code), int maxResultCount = 10, int skipCount = 0, bool includeDetails = false, diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IUserPictureProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IUserPictureProvider.cs index ab98dbab6..678e52b55 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IUserPictureProvider.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IUserPictureProvider.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; +using System.IO; using System.Threading.Tasks; using Volo.Abp.Identity; @@ -7,7 +6,7 @@ namespace LINGYUN.Abp.Identity; public interface IUserPictureProvider { - Task SetPictureAsync(IdentityUser user, Stream stream, string fileName = null); + Task SetPictureAsync(IdentityUser user, Stream stream, string? fileName = null); Task GetPictureAsync(string userId); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IdentityDomainMappers.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IdentityDomainMappers.cs index 049bdc239..c6a61210e 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IdentityDomainMappers.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IdentityDomainMappers.cs @@ -15,14 +15,14 @@ public partial class IdentitySessionToIdentitySessionEtoMapper : MapperBase TryGetProperties(IdentitySession source) + private static Dictionary TryGetProperties(IdentitySession source) { - var properties = new Dictionary(); + var properties = new Dictionary(); if (source != null && source.ExtraProperties != null) { foreach (var property in source.ExtraProperties) { - properties[property.Key] = property.Value.ToString(); + properties[property.Key] = property.Value?.ToString(); } } return properties; diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/DefaultAuthenticatorUriGenerator.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/DefaultAuthenticatorUriGenerator.cs index 5b0564cf2..1d894cadf 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/DefaultAuthenticatorUriGenerator.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/DefaultAuthenticatorUriGenerator.cs @@ -21,7 +21,7 @@ public class DefaultAuthenticatorUriGenerator : IAuthenticatorUriGenerator, ITra public virtual string Generate(string email, string unformattedKey) { - var application = _urlEncoder.Encode(_applicationInfoAccessor.ApplicationName); + var application = _urlEncoder.Encode(_applicationInfoAccessor.ApplicationName ?? "IdentityApplication"); var account = _urlEncoder.Encode(email); return string.Format(OTatpUrlFormat, application, account, unformattedKey, application); diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/SecurityTokenCacheItem.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/SecurityTokenCacheItem.cs index 16377c9fa..e046950f0 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/SecurityTokenCacheItem.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/SecurityTokenCacheItem.cs @@ -10,7 +10,7 @@ public class SecurityTokenCacheItem /// /// 用于验证的Token /// - public string Token { get; set; } + public string Token { get; set; } = default!; /// /// 用于验证的用户Id /// @@ -18,7 +18,7 @@ public class SecurityTokenCacheItem /// /// 用于验证的安全令牌 /// - public string SecurityToken { get; set; } + public string SecurityToken { get; set; } = default!; public SecurityTokenCacheItem() { diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IIdentitySessionStore.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IIdentitySessionStore.cs index 5e76c2704..eac541043 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IIdentitySessionStore.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IIdentitySessionStore.cs @@ -29,14 +29,14 @@ public interface IIdentitySessionStore Task CreateAsync( string sessionId, string device, - string deviceInfo, + string? deviceInfo, Guid userId, - string clientId, - string ipAddresses, + string? clientId, + string? ipAddresses, DateTime signedIn, DateTime? lastAccessed = null, - string ipRegion = null, - string userName = null, + string? ipRegion = null, + string? userName = null, Guid? tenantId = null, CancellationToken cancellationToken = default); /// @@ -64,7 +64,7 @@ public interface IIdentitySessionStore /// 会话key /// /// 如果存在返回 的实例, 否则返回 null. - Task FindAsync( + Task FindAsync( Guid id, CancellationToken cancellationToken = default); /// @@ -83,7 +83,7 @@ public interface IIdentitySessionStore /// 会话id /// /// 如果存在返回 的实例, 否则返回 null. - Task FindAsync( + Task FindAsync( string sessionId, CancellationToken cancellationToken = default); /// @@ -93,7 +93,7 @@ public interface IIdentitySessionStore /// 设备 /// /// 如果存在返回 的实例, 否则返回 null. - Task FindLastAsync( + Task FindLastAsync( Guid userId, string device, CancellationToken cancellationToken = default); @@ -168,7 +168,7 @@ public interface IIdentitySessionStore /// Task RevokeWithAsync( Guid userId, - string device = null, + string? device = null, Guid? exceptSessionId = null, int maxCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionStore.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionStore.cs index 7a9b29632..508bb5632 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionStore.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionStore.cs @@ -30,14 +30,14 @@ public class IdentitySessionStore : IIdentitySessionStore, ITransientDependency public async virtual Task CreateAsync( string sessionId, string device, - string deviceInfo, + string? deviceInfo, Guid userId, - string clientId, - string ipAddresses, + string? clientId, + string? ipAddresses, DateTime signedIn, DateTime? lastAccessed = null, - string ipRegion = null, - string userName = null, + string? ipRegion = null, + string? userName = null, Guid? tenantId = null, CancellationToken cancellationToken = default) { @@ -85,7 +85,7 @@ public class IdentitySessionStore : IIdentitySessionStore, ITransientDependency return await IdentitySessionRepository.GetAsync(id, cancellationToken: cancellationToken); } - public async virtual Task FindAsync( + public async virtual Task FindAsync( Guid id, CancellationToken cancellationToken = default) { @@ -99,14 +99,14 @@ public class IdentitySessionStore : IIdentitySessionStore, ITransientDependency return await IdentitySessionRepository.GetAsync(sessionId, cancellationToken: cancellationToken); } - public async virtual Task FindAsync( + public async virtual Task FindAsync( string sessionId, CancellationToken cancellationToken = default) { return await IdentitySessionRepository.FindAsync(sessionId, cancellationToken: cancellationToken); } - public async virtual Task FindLastAsync( + public async virtual Task FindLastAsync( Guid userId, string device, CancellationToken cancellationToken = default) @@ -161,7 +161,7 @@ public class IdentitySessionStore : IIdentitySessionStore, ITransientDependency public async virtual Task RevokeWithAsync( Guid userId, - string device = null, + string? device = null, Guid? exceptSessionId = null, int maxCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/PasswordHistoryPasswordValidator.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/PasswordHistoryPasswordValidator.cs index 99986fb29..4091e0e4b 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/PasswordHistoryPasswordValidator.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/PasswordHistoryPasswordValidator.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Identity; public class PasswordHistoryPasswordValidator : IPasswordValidator { - public async virtual Task ValidateAsync(UserManager manager, IdentityUser user, string password) + public async virtual Task ValidateAsync(UserManager manager, IdentityUser user, string? password) { var settingProvider = manager.ServiceProvider.GetRequiredService(); if (await settingProvider.IsTrueAsync(IdentitySettingNames.Password.EnablePreventPasswordReuse)) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySessionRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySessionRepository.cs index 973019971..d5e7ef638 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySessionRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySessionRepository.cs @@ -19,9 +19,9 @@ public class EfCoreIdentitySessionRepository : Volo.Abp.Identity.EntityFramework { } - public async virtual Task FindLastAsync( + public async virtual Task FindLastAsync( Guid userId, - string device = null, + string? device = null, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) @@ -42,7 +42,7 @@ public class EfCoreIdentitySessionRepository : Volo.Abp.Identity.EntityFramework public async virtual Task> GetListAsync( Guid userId, - string device, + string? device = null, Guid? exceptSessionId = null, int maxResultCount = 0, CancellationToken cancellationToken = default) @@ -72,7 +72,7 @@ public class EfCoreIdentitySessionRepository : Volo.Abp.Identity.EntityFramework public async virtual Task> GetListAsync( ISpecification specification, - string sorting = $"{nameof(IdentitySession.SignedIn)} DESC", + string? sorting = $"{nameof(IdentitySession.SignedIn)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserInactiveRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserInactiveRepository.cs index 01a2b7460..d18e112be 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserInactiveRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserInactiveRepository.cs @@ -21,7 +21,7 @@ public class EfCoreIdentityUserInactiveRepository : EfCoreRepository FindByUserIdAsync( + public async virtual Task FindByUserIdAsync( Guid userId, CancellationToken cancellationToken = default) { @@ -32,7 +32,7 @@ public class EfCoreIdentityUserInactiveRepository : EfCoreRepository GetInactiveUserCountAsync( DateTime threshold, - IEnumerable exceptUserIds = null, + IEnumerable? exceptUserIds = null, CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(); @@ -40,7 +40,7 @@ public class EfCoreIdentityUserInactiveRepository : EfCoreRepository x.UserId); return await dbContext.Set() - .WhereIf(exceptUserIds?.Count() > 0, x => !exceptUserIds.Contains(x.Id)) + .WhereIf(exceptUserIds?.Count() > 0, x => !exceptUserIds!.Contains(x.Id)) .Where(x => !ignoreUserIds.Contains(x.Id)) .Where(x => x.IsActive && ((x.LastSignInTime.HasValue && x.LastSignInTime < threshold) || @@ -52,8 +52,8 @@ public class EfCoreIdentityUserInactiveRepository : EfCoreRepository> GetInactiveUserListAsync( DateTime threshold, - IEnumerable exceptUserIds = null, - string sorting = nameof(IdentityUser.LastSignInTime), + IEnumerable? exceptUserIds = null, + string? sorting = nameof(IdentityUser.LastSignInTime), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) @@ -63,7 +63,7 @@ public class EfCoreIdentityUserInactiveRepository : EfCoreRepository x.UserId); return await dbContext.Set() - .WhereIf(exceptUserIds?.Count() > 0, x => !exceptUserIds.Contains(x.Id)) + .WhereIf(exceptUserIds?.Count() > 0, x => !exceptUserIds!.Contains(x.Id)) .Where(x => !ignoreUserIds.Contains(x.Id)) .Where(x => x.IsActive && ((x.LastSignInTime.HasValue && x.LastSignInTime < threshold) || @@ -86,7 +86,7 @@ public class EfCoreIdentityUserInactiveRepository : EfCoreRepository> GetListAsync( ISpecification specification, - string sorting = nameof(IdentityUserInactive.CreationTime), + string? sorting = nameof(IdentityUserInactive.CreationTime), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs index 7ed55a8be..b13885900 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs @@ -46,7 +46,7 @@ public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCor GetCancellationToken(cancellationToken)); } - public async virtual Task FindByPhoneNumberAsync( + public async virtual Task FindByPhoneNumberAsync( string phoneNumber, bool isConfirmed = true, bool includeDetails = false, @@ -70,7 +70,7 @@ public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCor public async virtual Task> GetOrganizationUnitsAsync( Guid id, - string filter = null, + string? filter = null, bool includeDetails = false, int skipCount = 1, int maxResultCount = 10, @@ -105,14 +105,14 @@ public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCor select ou; return await query - .WhereIf(!filter.IsNullOrWhiteSpace(), ou => ou.Code.Contains(filter) || ou.DisplayName.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), ou => ou.Code.Contains(filter!) || ou.DisplayName.Contains(filter!)) .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellationToken)); } public async virtual Task GetUsersInOrganizationUnitCountAsync( Guid organizationUnitId, - string filter = null, + string? filter = null, CancellationToken cancellationToken = default ) { @@ -123,15 +123,15 @@ public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCor select user; return await query .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) + user => user.Name.Contains(filter!) || user.UserName.Contains(filter!) || + user.Surname.Contains(filter!) || user.Email.Contains(filter!) || + user.PhoneNumber.Contains(filter!)) .LongCountAsync(GetCancellationToken(cancellationToken)); } public async virtual Task> GetUsersInOrganizationUnitAsync( Guid organizationUnitId, - string filter = null, + string? filter = null, int skipCount = 1, int maxResultCount = 10, CancellationToken cancellationToken = default @@ -144,16 +144,16 @@ public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCor select user; return await query .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) + user => user.Name.Contains(filter!) || user.UserName.Contains(filter!) || + user.Surname.Contains(filter!) || user.Email.Contains(filter!) || + user.PhoneNumber.Contains(filter!)) .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellationToken)); } public async virtual Task GetUsersInOrganizationsListCountAsync( List organizationUnitIds, - string filter = null, + string? filter = null, CancellationToken cancellationToken = default ) { @@ -164,15 +164,15 @@ public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCor select user; return await query .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) + user => user.Name.Contains(filter!) || user.UserName.Contains(filter!) || + user.Surname.Contains(filter!) || user.Email.Contains(filter!) || + user.PhoneNumber.Contains(filter!)) .LongCountAsync(GetCancellationToken(cancellationToken)); } public async virtual Task> GetUsersInOrganizationsListAsync( List organizationUnitIds, - string filter = null, + string? filter = null, int skipCount = 1, int maxResultCount = 10, CancellationToken cancellationToken = default @@ -185,16 +185,16 @@ public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCor select user; return await query .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) + user => user.Name.Contains(filter!) || user.UserName.Contains(filter!) || + user.Surname.Contains(filter!) || user.Email.Contains(filter!) || + user.PhoneNumber.Contains(filter!)) .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellationToken)); } public async virtual Task GetUsersInOrganizationUnitWithChildrenCountAsync( string code, - string filter = null, + string? filter = null, CancellationToken cancellationToken = default ) { @@ -206,15 +206,15 @@ public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCor select user; return await query .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) + user => user.Name.Contains(filter!) || user.UserName.Contains(filter!) || + user.Surname.Contains(filter!) || user.Email.Contains(filter!) || + user.PhoneNumber.Contains(filter!)) .LongCountAsync(GetCancellationToken(cancellationToken)); } public async virtual Task> GetUsersInOrganizationUnitWithChildrenAsync( string code, - string filter = null, + string? filter = null, int skipCount = 1, int maxResultCount = 10, CancellationToken cancellationToken = default @@ -228,9 +228,9 @@ public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCor select user; return await query .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) + user => user.Name.Contains(filter!) || user.UserName.Contains(filter!) || + user.Surname.Contains(filter!) || user.Email.Contains(filter!) || + user.PhoneNumber.Contains(filter!)) .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellationToken)); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreOrganizationUnitRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreOrganizationUnitRepository.cs index ee24032c2..5442fd6a4 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreOrganizationUnitRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreOrganizationUnitRepository.cs @@ -31,7 +31,7 @@ public class EfCoreOrganizationUnitRepository : Volo.Abp.Identity.EntityFramewor public async virtual Task> GetListAsync( ISpecification specification, - string sorting = nameof(OrganizationUnit.Code), + string? sorting = nameof(OrganizationUnit.Code), int maxResultCount = 10, int skipCount = 0, bool includeDetails = false, diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeCacheItem.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeCacheItem.cs index 5d6e90b4a..734a67d3c 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeCacheItem.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeCacheItem.cs @@ -6,12 +6,12 @@ namespace LINGYUN.Abp.Identity.QrCode; [IgnoreMultiTenancy] public class QrCodeCacheItem { - public string Key { get; set; } - public string Token { get; set; } + public string Key { get; set; } = default!; + public string? Token { get; set; } public QrCodeStatus Status { get; set; } - public string UserId { get; set; } - public string UserName { get; set; } - public string Picture { get; set; } + public string? UserId { get; set; } + public string? UserName { get; set; } + public string? Picture { get; set; } public Guid? TenantId { get; set; } public QrCodeCacheItem() { diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeInfo.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeInfo.cs index 80632573b..53f54135d 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeInfo.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeInfo.cs @@ -4,13 +4,13 @@ namespace LINGYUN.Abp.Identity.QrCode; public class QrCodeInfo { - public string Key { get; } - public string Token { get; private set; } + public string Key { get; } = default!; + public string? Token { get; private set; } public QrCodeStatus Status { get; private set; } - public string UserId { get; set; } + public string? UserId { get; set; } public Guid? TenantId { get; set; } - public string UserName { get; set; } - public string Picture { get; set; } + public string? UserName { get; set; } + public string? Picture { get; set; } public QrCodeInfo(string key) { @@ -18,7 +18,7 @@ public class QrCodeInfo Status = QrCodeStatus.Created; } - public void SetToken(string token) + public void SetToken(string? token) { Token = token; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeLoginProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeLoginProvider.cs index d8e54c287..5c4529951 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeLoginProvider.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeLoginProvider.cs @@ -150,7 +150,7 @@ public class QrCodeLoginProvider : IQrCodeLoginProvider, ITransientDependency { var user = await UserManager.FindByIdAsync(userId); - return await UserManager.GenerateUserTokenAsync(user, + return await UserManager.GenerateUserTokenAsync(user!, QrCodeLoginProviderConsts.Name, QrCodeLoginProviderConsts.Purpose); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/HttpContextDeviceInfoProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/HttpContextDeviceInfoProvider.cs index 8d434ad71..1cec4be77 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/HttpContextDeviceInfoProvider.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/HttpContextDeviceInfoProvider.cs @@ -27,10 +27,14 @@ public class HttpContextDeviceInfoProvider : IDeviceInfoProvider, ITransientDepe Options = options.Value; } - public string ClientIpAddress => WebClientInfoProvider.ClientIpAddress; + public string? ClientIpAddress => WebClientInfoProvider.ClientIpAddress; public async virtual Task GetDeviceInfoAsync() { + if (WebClientInfoProvider.BrowserInfo.IsNullOrWhiteSpace()) + { + return new DeviceInfo("unknown", "unknown", "unknown", "unknown"); + } var deviceInfo = BrowserDeviceInfo.Parse(HttpUserAgentParser, WebClientInfoProvider.BrowserInfo); var ipAddress = WebClientInfoProvider.ClientIpAddress; var ipRegion = ""; @@ -53,7 +57,7 @@ public class HttpContextDeviceInfoProvider : IDeviceInfoProvider, ITransientDepe ipRegion); } - protected async virtual Task GetRegion(string ipAddress) + protected async virtual Task GetRegion(string ipAddress) { var locationInfo = await IPLocationResolver.ResolveAsync(ipAddress); return locationInfo.Location?.Remarks; @@ -62,9 +66,9 @@ public class HttpContextDeviceInfoProvider : IDeviceInfoProvider, ITransientDepe private class BrowserDeviceInfo { public string Device { get; } - public string Description { get; } + public string? Description { get; } - public BrowserDeviceInfo(string device, string description) + public BrowserDeviceInfo(string device, string? description) { Device = device; Description = description; @@ -72,8 +76,8 @@ public class HttpContextDeviceInfoProvider : IDeviceInfoProvider, ITransientDepe public static BrowserDeviceInfo Parse(IHttpUserAgentParserProvider httpUserAgentParserProvider, string browserInfo) { - string device = null; - string deviceInfo = null; + var device = "unknown"; + string? deviceInfo = null; if (!browserInfo.IsNullOrWhiteSpace()) { var httpUserAgentInformation = httpUserAgentParserProvider.Parse(browserInfo); diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultIdentitySessionCache.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultIdentitySessionCache.cs index 0067026b7..f00689cac 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultIdentitySessionCache.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultIdentitySessionCache.cs @@ -21,7 +21,7 @@ public class DefaultIdentitySessionCache : IIdentitySessionCache, ITransientDepe Logger = NullLogger.Instance; } - public async virtual Task GetAsync(string sessionId, CancellationToken cancellationToken = default) + public async virtual Task GetAsync(string sessionId, CancellationToken cancellationToken = default) { Logger.LogDebug($"Get user session cache for: {sessionId}"); var cacheKey = IdentitySessionCacheItem.CalculateCacheKey(sessionId); @@ -34,7 +34,7 @@ public class DefaultIdentitySessionCache : IIdentitySessionCache, ITransientDepe Logger.LogDebug($"Refresh user session cache for: {sessionId}"); var cacheKey = IdentitySessionCacheItem.CalculateCacheKey(sessionId); - DistributedCacheEntryOptions cacheOptions = null; + DistributedCacheEntryOptions? cacheOptions = null; if (cacheItem.ExpiraIn.HasValue) { cacheOptions = new DistributedCacheEntryOptions diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultSessionInfoProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultSessionInfoProvider.cs index b49e756ed..237420ca7 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultSessionInfoProvider.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultSessionInfoProvider.cs @@ -9,11 +9,11 @@ namespace LINGYUN.Abp.Identity.Session; [Dependency(ServiceLifetime.Singleton, TryRegister = true)] public class DefaultSessionInfoProvider : ISessionInfoProvider { - private readonly AsyncLocal _currentSessionId = new AsyncLocal(); + private readonly AsyncLocal _currentSessionId = new AsyncLocal(); - public string SessionId => _currentSessionId.Value; + public string? SessionId => _currentSessionId.Value; - public virtual IDisposable Change(string sessionId) + public virtual IDisposable Change(string? sessionId) { var parent = SessionId; _currentSessionId.Value = sessionId; diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DeviceInfo.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DeviceInfo.cs index 9434fded2..e50647a86 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DeviceInfo.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DeviceInfo.cs @@ -2,10 +2,10 @@ public class DeviceInfo { public string Device { get; } - public string Description { get; } - public string ClientIpAddress { get; } - public string IpRegion { get; } - public DeviceInfo(string device, string description, string clientIpAddress, string ipRegion) + public string? Description { get; } + public string? ClientIpAddress { get; } + public string? IpRegion { get; } + public DeviceInfo(string device, string? description, string? clientIpAddress, string? ipRegion) { Device = device; Description = description; diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IDeviceInfoProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IDeviceInfoProvider.cs index c4ea02ab0..39da4f159 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IDeviceInfoProvider.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IDeviceInfoProvider.cs @@ -5,5 +5,5 @@ public interface IDeviceInfoProvider { Task GetDeviceInfoAsync(); - string ClientIpAddress { get; } + string? ClientIpAddress { get; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IIdentitySessionCache.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IIdentitySessionCache.cs index 13f6f5db9..4ee7639d9 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IIdentitySessionCache.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IIdentitySessionCache.cs @@ -6,7 +6,7 @@ public interface IIdentitySessionCache { Task RefreshAsync(string sessionId, IdentitySessionCacheItem cacheItem, CancellationToken cancellationToken = default); - Task GetAsync(string sessionId, CancellationToken cancellationToken = default); + Task GetAsync(string sessionId, CancellationToken cancellationToken = default); Task RemoveAsync(string sessionId, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/ISessionInfoProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/ISessionInfoProvider.cs index 6ae517cf0..29ceb05e3 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/ISessionInfoProvider.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/ISessionInfoProvider.cs @@ -3,7 +3,7 @@ namespace LINGYUN.Abp.Identity.Session; public interface ISessionInfoProvider { - string SessionId { get; } + string? SessionId { get; } - IDisposable Change(string sessionId); + IDisposable Change(string? sessionId); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItem.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItem.cs index 05328cede..f2a8683a3 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItem.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItem.cs @@ -9,11 +9,11 @@ public class IdentitySessionCacheItem /// /// 登录设备 /// - public string Device { get; set; } + public string Device { get; set; } = default!; /// /// 设备描述 /// - public string DeviceInfo { get; set; } + public string? DeviceInfo { get; set; } /// /// 用户Id /// @@ -21,19 +21,19 @@ public class IdentitySessionCacheItem /// /// 会话Id /// - public string SessionId { get; set; } + public string SessionId { get; set; } = default!; /// /// 客户端Id /// - public string ClientId { get; set; } + public string? ClientId { get; set; } /// /// IP地址 /// - public string IpAddresses { get; set; } + public string? IpAddresses { get; set; } /// /// IP属地 /// - public string IpRegion { get; set; } + public string? IpRegion { get; set; } /// /// 登录时间 /// @@ -56,11 +56,11 @@ public class IdentitySessionCacheItem string deviceInfo, Guid userId, string sessionId, - string clientId, - string ipAddresses, + string? clientId, + string? ipAddresses, DateTime signedIn, DateTime? lastAccessed = null, - string ipRegion = null, + string? ipRegion = null, double? expiraIn = null) { Device = device; diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionChangeAccessedEvent.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionChangeAccessedEvent.cs index 8d182da0a..79f313a9c 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionChangeAccessedEvent.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionChangeAccessedEvent.cs @@ -8,8 +8,8 @@ namespace LINGYUN.Abp.Identity.Session; public class IdentitySessionChangeAccessedEvent : IMultiTenant { public Guid? TenantId { get; set; } - public string SessionId { get; set; } - public string IpAddresses { get; set; } + public string SessionId { get; set; } = default!; + public string? IpAddresses { get; set; } public DateTime LastAccessed { get; set; } public IdentitySessionChangeAccessedEvent() { @@ -17,7 +17,7 @@ public class IdentitySessionChangeAccessedEvent : IMultiTenant } public IdentitySessionChangeAccessedEvent( string sessionId, - string ipAddresses, + string? ipAddresses, DateTime lastAccessed, Guid? tenantId = null) { diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/NoneDeviceInfoProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/NoneDeviceInfoProvider.cs index 55bf72836..aa48caf30 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/NoneDeviceInfoProvider.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/NoneDeviceInfoProvider.cs @@ -14,5 +14,5 @@ public class NoneDeviceInfoProvider : IDeviceInfoProvider return Task.FromResult(DeviceInfo); } - public string ClientIpAddress => "::1"; + public string? ClientIpAddress => "::1"; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs index ef3ea6c36..5b2cd2ad1 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs @@ -8,5 +8,5 @@ public class ApiResourceCreateDto : ApiResourceCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.NameMaxLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs index 73701e5ca..39d40d29a 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs @@ -7,14 +7,14 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources; public class ApiResourceCreateOrUpdateDto { [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.DisplayNameMaxLength))] - public string DisplayName { get; set; } + public string? DisplayName { get; set; } [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.DescriptionMaxLength))] - public string Description { get; set; } + public string? Description { get; set; } public bool Enabled { get; set; } - public string AllowedAccessTokenSigningAlgorithms { get; set; } + public string? AllowedAccessTokenSigningAlgorithms { get; set; } public bool ShowInDiscoveryDocument { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs index b0a798136..fc9c601a1 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs @@ -6,15 +6,15 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources; public class ApiResourceDto : ExtensibleAuditedEntityDto { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string? DisplayName { get; set; } - public string Description { get; set; } + public string? Description { get; set; } public bool Enabled { get; set; } - public string AllowedAccessTokenSigningAlgorithms { get; set; } + public string? AllowedAccessTokenSigningAlgorithms { get; set; } public bool ShowInDiscoveryDocument { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceGetByPagedInputDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceGetByPagedInputDto.cs index 400b36c9c..7272ebcf0 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceGetByPagedInputDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceGetByPagedInputDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.IdentityServer.ApiResources; public class ApiResourceGetByPagedInputDto : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeCreateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeCreateDto.cs index a2510440c..f1d2b3b8b 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeCreateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeCreateDto.cs @@ -13,13 +13,13 @@ public class ApiResourceScopeCreateDto [Required] [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.NameMaxLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.DisplayNameMaxLength))] - public string DisplayName { get; set; } + public string? DisplayName { get; set; } [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.DescriptionMaxLength))] - public string Description { get; set; } + public string? Description { get; set; } public bool Required { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeDto.cs index 84b3c1a13..0c1399ff4 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeDto.cs @@ -2,5 +2,5 @@ public class ApiResourceScopeDto { - public string Scope { get; set; } + public string? Scope { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateDto.cs index 9925cd3b6..bdd49e192 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateDto.cs @@ -1,6 +1,12 @@ -namespace LINGYUN.Abp.IdentityServer.ApiScopes; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.IdentityServer.ApiScopes; +using Volo.Abp.Validation; + +namespace LINGYUN.Abp.IdentityServer.ApiScopes; public class ApiScopeCreateDto : ApiScopeCreateOrUpdateDto { - public string Name { get; set; } + [Required] + [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.NameMaxLength))] + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateOrUpdateDto.cs index 43f25d202..c51f92e51 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateOrUpdateDto.cs @@ -1,4 +1,6 @@ using System.Collections.Generic; +using Volo.Abp.IdentityServer.ApiScopes; +using Volo.Abp.Validation; namespace LINGYUN.Abp.IdentityServer.ApiScopes; @@ -6,9 +8,11 @@ public class ApiScopeCreateOrUpdateDto { public bool Enabled { get; set; } - public string DisplayName { get; set; } + [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.DisplayNameMaxLength))] + public string? DisplayName { get; set; } - public string Description { get; set; } + [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.DescriptionMaxLength))] + public string? Description { get; set; } public bool Required { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeDto.cs index e1560e82d..2e35f61f0 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeDto.cs @@ -8,11 +8,11 @@ public class ApiScopeDto : ExtensibleAuditedEntityDto { public bool Enabled { get; set; } - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string? DisplayName { get; set; } - public string Description { get; set; } + public string? Description { get; set; } public bool Required { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopePropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopePropertyDto.cs index ead5854f8..5c29e5890 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopePropertyDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopePropertyDto.cs @@ -4,7 +4,7 @@ namespace LINGYUN.Abp.IdentityServer.ApiScopes; public class ApiScopePropertyDto : EntityDto { - public string Key { get; set; } + public string Key { get; set; } = default!; - public string Value { get; set; } + public string? Value { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/GetApiScopeInput.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/GetApiScopeInput.cs index 466124733..202117290 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/GetApiScopeInput.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/GetApiScopeInput.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.IdentityServer.ApiScopes; public class GetApiScopeInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientClaimDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientClaimDto.cs index 0cbab909e..86a0d1e2b 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientClaimDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientClaimDto.cs @@ -2,7 +2,7 @@ public class ClientClaimDto { - public string Type { get; set; } + public string Type { get; set; } = default!; - public string Value { get; set; } + public string? Value { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs index d92aab6df..585ddec41 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs @@ -11,18 +11,18 @@ public class ClientCloneDto /// [Required] [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientIdMaxLength))] - public string ClientId { get; set; } + public string ClientId { get; set; } = default!; /// /// 客户端名称 /// [Required] [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientNameMaxLength))] - public string ClientName { get; set; } + public string ClientName { get; set; } = default!; /// /// 说明 /// [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.DescriptionMaxLength))] - public string Description { get; set; } + public string? Description { get; set; } /// /// 复制客户端授权类型 /// diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCorsOriginDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCorsOriginDto.cs index 50ed454bb..6af83181d 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCorsOriginDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCorsOriginDto.cs @@ -2,5 +2,5 @@ public class ClientCorsOriginDto { - public string Origin { get; set; } + public string Origin { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs index 6b4db72b3..ed204eebf 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs @@ -9,14 +9,13 @@ public class ClientCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientIdMaxLength))] - public string ClientId { get; set; } + public string ClientId { get; set; } = default!; - [Required] [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientNameMaxLength))] - public string ClientName { get; set; } + public string? ClientName { get; set; } [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.DescriptionMaxLength))] - public string Description { get; set; } + public string? Description { get; set; } public List AllowedGrantTypes { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs index 71ed2656e..23e0c9de7 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs @@ -6,19 +6,19 @@ namespace LINGYUN.Abp.IdentityServer.Clients; public class ClientDto : FullAuditedEntityDto { - public string ClientId { get; set; } + public string ClientId { get; set; } = default!; - public string ClientName { get; set; } + public string? ClientName { get; set; } - public string Description { get; set; } + public string? Description { get; set; } - public string ClientUri { get; set; } + public string? ClientUri { get; set; } - public string LogoUri { get; set; } + public string? LogoUri { get; set; } public bool Enabled { get; set; } - public string ProtocolType { get; set; } + public string ProtocolType { get; set; } = default!; public bool RequireClientSecret { get; set; } @@ -28,7 +28,7 @@ public class ClientDto : FullAuditedEntityDto public bool RequireRequestObject { get; set; } - public string AllowedIdentityTokenSigningAlgorithms { get; set; } + public string? AllowedIdentityTokenSigningAlgorithms { get; set; } public bool AlwaysIncludeUserClaimsInIdToken { get; set; } @@ -38,11 +38,11 @@ public class ClientDto : FullAuditedEntityDto public bool AllowAccessTokensViaBrowser { get; set; } - public string FrontChannelLogoutUri { get; set; } + public string? FrontChannelLogoutUri { get; set; } public bool FrontChannelLogoutSessionRequired { get; set; } - public string BackChannelLogoutUri { get; set; } + public string? BackChannelLogoutUri { get; set; } public bool BackChannelLogoutSessionRequired { get; set; } @@ -74,17 +74,17 @@ public class ClientDto : FullAuditedEntityDto public bool AlwaysSendClientClaims { get; set; } - public string ClientClaimsPrefix { get; set; } + public string? ClientClaimsPrefix { get; set; } - public string PairWiseSubjectSalt { get; set; } + public string? PairWiseSubjectSalt { get; set; } public int? UserSsoLifetime { get; set; } - public string UserCodeType { get; set; } + public string? UserCodeType { get; set; } public int DeviceCodeLifetime { get; set; } - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; public List AllowedScopes { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedDto.cs index eeec7183b..989f7d26e 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.IdentityServer.Clients; public class ClientGetByPagedDto : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGrantTypeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGrantTypeDto.cs index f9b035a2b..b4792a5de 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGrantTypeDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGrantTypeDto.cs @@ -2,5 +2,5 @@ public class ClientGrantTypeDto { - public string GrantType { get; set; } + public string GrantType { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientIdPRestrictionDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientIdPRestrictionDto.cs index 2edcdac21..79b680fe0 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientIdPRestrictionDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientIdPRestrictionDto.cs @@ -2,5 +2,5 @@ public class ClientIdPRestrictionDto { - public string Provider { get; set; } + public string Provider { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPostLogoutRedirectUriDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPostLogoutRedirectUriDto.cs index 2a9db2001..8333b623c 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPostLogoutRedirectUriDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPostLogoutRedirectUriDto.cs @@ -2,5 +2,5 @@ public class ClientPostLogoutRedirectUriDto { - public string PostLogoutRedirectUri { get; set; } + public string PostLogoutRedirectUri { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientRedirectUriDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientRedirectUriDto.cs index 3e555e678..b2c8e1e59 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientRedirectUriDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientRedirectUriDto.cs @@ -2,5 +2,5 @@ public class ClientRedirectUriDto { - public string RedirectUri { get; set; } + public string RedirectUri { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs index 1ba5d5ce8..c959541ee 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs @@ -8,20 +8,20 @@ public class ClientUpdateDto : ClientCreateOrUpdateDto { [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientUriMaxLength))] - public string ClientUri { get; set; } + public string? ClientUri { get; set; } [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.LogoUriMaxLength))] - public string LogoUri { get; set; } + public string? LogoUri { get; set; } public bool Enabled { get; set; } [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ProtocolTypeMaxLength))] - public string ProtocolType { get; set; } + public string? ProtocolType { get; set; } public bool RequireClientSecret { get; set; } [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.AllowedIdentityTokenSigningAlgorithms))] - public string AllowedIdentityTokenSigningAlgorithms { get; set; } + public string? AllowedIdentityTokenSigningAlgorithms { get; set; } public bool RequireConsent { get; set; } = false; @@ -38,12 +38,12 @@ public class ClientUpdateDto : ClientCreateOrUpdateDto public bool AllowAccessTokensViaBrowser { get; set; } [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.FrontChannelLogoutUriMaxLength))] - public string FrontChannelLogoutUri { get; set; } + public string? FrontChannelLogoutUri { get; set; } public bool FrontChannelLogoutSessionRequired { get; set; } [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.BackChannelLogoutUriMaxLength))] - public string BackChannelLogoutUri { get; set; } + public string? BackChannelLogoutUri { get; set; } public bool BackChannelLogoutSessionRequired { get; set; } @@ -76,15 +76,15 @@ public class ClientUpdateDto : ClientCreateOrUpdateDto public bool AlwaysSendClientClaims { get; set; } [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientClaimsPrefixMaxLength))] - public string ClientClaimsPrefix { get; set; } + public string? ClientClaimsPrefix { get; set; } [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.PairWiseSubjectSaltMaxLength))] - public string PairWiseSubjectSalt { get; set; } + public string? PairWiseSubjectSalt { get; set; } public int? UserSsoLifetime { get; set; } [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.UserCodeTypeMaxLength))] - public string UserCodeType { get; set; } + public string? UserCodeType { get; set; } public int DeviceCodeLifetime { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Devices/Dto/DeviceFlowCodesDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Devices/Dto/DeviceFlowCodesDto.cs index 456473a1d..deb272ecb 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Devices/Dto/DeviceFlowCodesDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Devices/Dto/DeviceFlowCodesDto.cs @@ -5,19 +5,19 @@ namespace LINGYUN.Abp.IdentityServer.Devices; public class DeviceFlowCodesDto : ExtensibleCreationAuditedEntityDto { - public string DeviceCode { get; set; } + public string DeviceCode { get; set; } = default!; - public string UserCode { get; set; } + public string UserCode { get; set; } = default!; - public string SubjectId { get; set; } + public string? SubjectId { get; set; } - public string SessionId { get; set; } + public string? SessionId { get; set; } - public string ClientId { get; set; } + public string ClientId { get; set; } = default!; - public string Description { get; set; } + public string? Description { get; set; } public DateTime? Expiration { get; set; } - public string Data { get; set; } + public string Data { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/GetPersistedGrantInput.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/GetPersistedGrantInput.cs index d7e9ead8c..6de849bf0 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/GetPersistedGrantInput.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/GetPersistedGrantInput.cs @@ -4,6 +4,6 @@ namespace LINGYUN.Abp.IdentityServer.Grants; public class GetPersistedGrantInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } - public string SubjectId { get; set; } + public string? Filter { get; set; } + public string? SubjectId { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs index d17c2d661..322c9455d 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs @@ -5,23 +5,23 @@ namespace LINGYUN.Abp.IdentityServer.Grants; public class PersistedGrantDto : ExtensibleEntityDto { - public string Key { get; set; } + public string Key { get; set; } = default!; - public string Type { get; set; } + public string Type { get; set; } = default!; - public string SubjectId { get; set; } + public string? SubjectId { get; set; } - public string SessionId { get; set; } + public string? SessionId { get; set; } - public string Description { get; set; } + public string? Description { get; set; } public DateTime? ConsumedTime { get; set; } - public string ClientId { get; set; } + public string ClientId { get; set; } = default!; public DateTime CreationTime { get; set; } public DateTime? Expiration { get; set; } - public string Data { get; set; } + public string Data { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs index 1d87e0c3d..9d50860e7 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs @@ -9,13 +9,13 @@ public class IdentityResourceCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(IdentityResourceConsts), nameof(IdentityResourceConsts.NameMaxLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [DynamicStringLength(typeof(IdentityResourceConsts), nameof(IdentityResourceConsts.DisplayNameMaxLength))] - public string DisplayName { get; set; } + public string? DisplayName { get; set; } [DynamicStringLength(typeof(IdentityResourceConsts), nameof(IdentityResourceConsts.DescriptionMaxLength))] - public string Description { get; set; } + public string? Description { get; set; } public bool Enabled { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs index e6e5ca4f0..48aa32e79 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs @@ -6,11 +6,11 @@ namespace LINGYUN.Abp.IdentityServer.IdentityResources; public class IdentityResourceDto : ExtensibleAuditedEntityDto { - public string Name { get; set; } - - public string DisplayName { get; set; } + public string Name { get; set; } = default!; + + public string? DisplayName { get; set; } - public string Description { get; set; } + public string? Description { get; set; } public bool Enabled { get; set; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceGetByPagedDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceGetByPagedDto.cs index e4409ff32..aedbf4e9a 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceGetByPagedDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceGetByPagedDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.IdentityServer.IdentityResources; public class IdentityResourceGetByPagedDto : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/PropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/PropertyDto.cs index 604d34790..6292c5f1f 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/PropertyDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/PropertyDto.cs @@ -2,7 +2,7 @@ public class PropertyDto { - public string Key { get; set; } + public string Key { get; set; } = default!; - public string Value { get; set; } + public string Value { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ScopeDto.cs index 03e15c773..1b55ab44f 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ScopeDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ScopeDto.cs @@ -2,5 +2,5 @@ public class ScopeDto { - public string Scope { get; set; } + public string Scope { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretDto.cs index 10135ea95..dbff717d2 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretDto.cs @@ -1,15 +1,14 @@ using System; -using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.IdentityServer; public class SecretDto { - public string Type { get; set; } + public string Type { get; set; } = default!; - public string Value { get; set; } + public string Value { get; set; } = default!; - public string Description { get; set; } + public string? Description { get; set; } public DateTime? Expiration { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/UserClaimDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/UserClaimDto.cs index b1f85ba14..3aa04be9d 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/UserClaimDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/UserClaimDto.cs @@ -2,5 +2,5 @@ public class UserClaimDto { - public string Type { get; set; } + public string Type { get; set; } = default!; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs index 211bfa942..2b73e589c 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs @@ -59,7 +59,7 @@ public class ApiResourceAppService : AbpIdentityServerAppServiceBase, IApiResour apiResource = await ApiResourceRepository.InsertAsync(apiResource); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(apiResource); } @@ -73,7 +73,7 @@ public class ApiResourceAppService : AbpIdentityServerAppServiceBase, IApiResour apiResource = await ApiResourceRepository.UpdateAsync(apiResource); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(apiResource); } @@ -84,7 +84,7 @@ public class ApiResourceAppService : AbpIdentityServerAppServiceBase, IApiResour var apiResource = await ApiResourceRepository.GetAsync(id); await ApiResourceRepository.DeleteAsync(apiResource); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } protected async virtual Task UpdateApiResourceByInputAsync(ApiResource apiResource, ApiResourceCreateOrUpdateDto input) @@ -100,8 +100,7 @@ public class ApiResourceAppService : AbpIdentityServerAppServiceBase, IApiResour { apiResource.DisplayName = input.DisplayName; } - if (apiResource.Description?.Equals(input.Description, StringComparison.InvariantCultureIgnoreCase) - == false) + if (apiResource.Description?.Equals(input.Description, StringComparison.InvariantCultureIgnoreCase) == false) { apiResource.Description = input.Description; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeAppService.cs index a91d8223e..c94763877 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeAppService.cs @@ -39,7 +39,7 @@ public class ApiScopeAppService : AbpIdentityServerAppServiceBase, IApiScopeAppS await UpdateApiScopeByInputAsync(apiScope, input); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); apiScope = await ApiScopeRepository.InsertAsync(apiScope); @@ -53,7 +53,7 @@ public class ApiScopeAppService : AbpIdentityServerAppServiceBase, IApiScopeAppS await ApiScopeRepository.DeleteAsync(apiScope); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(Guid id) @@ -86,7 +86,7 @@ public class ApiScopeAppService : AbpIdentityServerAppServiceBase, IApiScopeAppS await UpdateApiScopeByInputAsync(apiScope, input); apiScope = await ApiScopeRepository.UpdateAsync(apiScope); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(apiScope); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs index ca4fca282..74c9fa079 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs @@ -51,7 +51,7 @@ public class ClientAppService : AbpIdentityServerAppServiceBase, IClientAppServi client = await ClientRepository.InsertAsync(client); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(client); } @@ -62,7 +62,7 @@ public class ClientAppService : AbpIdentityServerAppServiceBase, IClientAppServi var client = await ClientRepository.GetAsync(id); await ClientRepository.DeleteAsync(client); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(Guid id) @@ -317,7 +317,7 @@ public class ClientAppService : AbpIdentityServerAppServiceBase, IClientAppServi client = await ClientRepository.UpdateAsync(client); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(client); } @@ -450,7 +450,7 @@ public class ClientAppService : AbpIdentityServerAppServiceBase, IClientAppServi } client = await ClientRepository.InsertAsync(client); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(client); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs index 7f416d6dd..f69380b00 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs @@ -24,7 +24,7 @@ public class PersistedGrantAppService : AbpIdentityServerAppServiceBase, IPersis var persistedGrant = await PersistentGrantRepository.GetAsync(id); await PersistentGrantRepository.DeleteAsync(persistedGrant); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(Guid id) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs index 5b583732b..bbb0b9bbe 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs @@ -51,7 +51,7 @@ public class IdentityResourceAppService : AbpIdentityServerAppServiceBase, IIden input.ShowInDiscoveryDocument); await UpdateApiResourceByInputAsync(identityResource, input); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); identityResource = await IdentityResourceRepository.InsertAsync(identityResource); @@ -65,7 +65,7 @@ public class IdentityResourceAppService : AbpIdentityServerAppServiceBase, IIden await UpdateApiResourceByInputAsync(identityResource, input); identityResource = await IdentityResourceRepository.UpdateAsync(identityResource); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(identityResource); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerEventServiceHandler.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerEventServiceHandler.cs index 9cafcf2f0..1edd6f940 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerEventServiceHandler.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerEventServiceHandler.cs @@ -106,11 +106,11 @@ public class AbpIdentityServerEventServiceHandler : IAbpIdentityServerEventServi /// protected virtual Task PrepareEventAsync(Event evt) { - evt.ActivityId = Context.HttpContext.TraceIdentifier; + evt.ActivityId = Context.HttpContext?.TraceIdentifier; evt.TimeStamp = Clock.Now; evt.ProcessId = Process.GetCurrentProcess().Id; - if (Context.HttpContext.Connection.LocalIpAddress != null) + if (Context.HttpContext?.Connection.LocalIpAddress != null) { evt.LocalIpAddress = Context.HttpContext.Connection.LocalIpAddress.ToString() + ":" + Context.HttpContext.Connection.LocalPort; } @@ -119,7 +119,7 @@ public class AbpIdentityServerEventServiceHandler : IAbpIdentityServerEventServi evt.LocalIpAddress = "unknown"; } - if (Context.HttpContext.Connection.RemoteIpAddress != null) + if (Context.HttpContext?.Connection.RemoteIpAddress != null) { evt.RemoteIpAddress = Context.HttpContext.Connection.RemoteIpAddress.ToString(); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs index 340f47f1b..f0d00ae3d 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs @@ -8,14 +8,14 @@ namespace LINGYUN.Abp.IdentityServer.Grants; public interface IPersistentGrantRepository : Volo.Abp.IdentityServer.Grants.IPersistentGrantRepository { Task GetCountAsync( - string subjectId = null, - string filter = null, + string? subjectId = null, + string? filter = null, CancellationToken cancellation = default); Task> GetListAsync( - string subjectId = null, - string filter = null, - string sorting = nameof(PersistedGrant.CreationTime), + string? subjectId = null, + string? filter = null, + string? sorting = nameof(PersistedGrant.CreationTime), int skipCount = 1, int maxResultCount = 10, CancellationToken cancellation = default); diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/Grants/EfCorePersistentGrantRepository.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/Grants/EfCorePersistentGrantRepository.cs index 78572db67..7dd564d65 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/Grants/EfCorePersistentGrantRepository.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/Grants/EfCorePersistentGrantRepository.cs @@ -25,16 +25,16 @@ public class EfCorePersistentGrantRepository : PersistentGrantRepository, IPersi { } - public async virtual Task GetCountAsync(string subjectId = null, string filter = null, CancellationToken cancellation = default) + public async virtual Task GetCountAsync(string? subjectId = null, string? filter = null, CancellationToken cancellation = default) { return await (await GetDbSetAsync()) .WhereIf(!subjectId.IsNullOrWhiteSpace(), x => x.SubjectId.Equals(subjectId)) .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Type.Contains(filter) || x.ClientId.Contains(filter) || x.Key.Contains(filter)) + x.Type.Contains(filter!) || x.ClientId.Contains(filter!) || x.Key.Contains(filter!)) .LongCountAsync(GetCancellationToken(cancellation)); } - public async virtual Task> GetListAsync(string subjectId = null, string filter = null, string sorting = "CreationTime", int skipCount = 1, int maxResultCount = 10, CancellationToken cancellation = default) + public async virtual Task> GetListAsync(string? subjectId = null, string? filter = null, string? sorting = "CreationTime", int skipCount = 1, int maxResultCount = 10, CancellationToken cancellation = default) { if (sorting.IsNullOrWhiteSpace()) { @@ -43,7 +43,7 @@ public class EfCorePersistentGrantRepository : PersistentGrantRepository, IPersi return await (await GetDbSetAsync()) .WhereIf(!subjectId.IsNullOrWhiteSpace(), x => x.SubjectId.Equals(subjectId)) .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Type.Contains(filter) || x.ClientId.Contains(filter) || x.Key.Contains(filter)) + x.Type.Contains(filter!) || x.ClientId.Contains(filter!) || x.Key.Contains(filter!)) .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellation)); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/LINGYUN/Abp/IdentityServer/LinkUser/LinkUserGrantValidator.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/LINGYUN/Abp/IdentityServer/LinkUser/LinkUserGrantValidator.cs index 5a5796652..3961f6744 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/LINGYUN/Abp/IdentityServer/LinkUser/LinkUserGrantValidator.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/LINGYUN/Abp/IdentityServer/LinkUser/LinkUserGrantValidator.cs @@ -142,7 +142,7 @@ public class LinkUserGrantValidator : IExtensionGrantValidator { if (user.TenantId.HasValue) { - customClaims.Add(new Claim(AbpClaimTypes.TenantId, user.TenantId?.ToString())); + customClaims.Add(new Claim(AbpClaimTypes.TenantId, user.TenantId.Value.ToString())); } return Task.CompletedTask; diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/PortalGrantValidator.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/PortalGrantValidator.cs index e5275048a..4ed7657fb 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/PortalGrantValidator.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/PortalGrantValidator.cs @@ -197,7 +197,7 @@ public class PortalGrantValidator : IExtensionGrantValidator var currentUser = await _userManager.GetUserAsync(resourceOwnerContext.Result.Subject); - await _events.RaiseAsync(new UserLoginSuccessEvent(userName, currentUser.Id.ToString(), currentUser.Name, clientId: resourceOwnerContext.Request.ClientId)); + await _events.RaiseAsync(new UserLoginSuccessEvent(userName, currentUser!.Id.ToString(), currentUser.Name, clientId: resourceOwnerContext.Request.ClientId)); await SetSuccessResultAsync(context, currentUser); } @@ -242,7 +242,7 @@ public class PortalGrantValidator : IExtensionGrantValidator await _identitySecurityLogManager.SaveAsync(logContext); } - protected virtual Task FindClientIdAsync(ExtensionGrantValidationContext context) + protected virtual Task FindClientIdAsync(ExtensionGrantValidationContext context) { return Task.FromResult(context.Request?.Client?.ClientId); } @@ -257,7 +257,7 @@ public class PortalGrantValidator : IExtensionGrantValidator customClaims.Add( new Claim( AbpClaimTypes.TenantId, - user.TenantId?.ToString() + user.TenantId.Value.ToString() ) ); } @@ -265,7 +265,7 @@ public class PortalGrantValidator : IExtensionGrantValidator return Task.CompletedTask; } - private Task RaiseFailedResourceOwnerAuthenticationEventAsync(string userName, string error, string clientId) + private Task RaiseFailedResourceOwnerAuthenticationEventAsync(string userName, string? error, string? clientId) { return _events.RaiseAsync(new UserLoginFailureEvent(userName, error, interactive: false, clientId: clientId)); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentitySessionEventServiceHandler.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentitySessionEventServiceHandler.cs index 38b6e1a03..c28a06163 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentitySessionEventServiceHandler.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentitySessionEventServiceHandler.cs @@ -73,7 +73,7 @@ public class AbpIdentitySessionEventServiceHandler : IAbpIdentityServerEventServ } if (CurrentTenant.IsAvailable) { - claimsIdentity.AddClaim(new Claim(AbpClaimTypes.TenantId, CurrentTenant.Id.ToString())); + claimsIdentity.AddClaim(new Claim(AbpClaimTypes.TenantId, CurrentTenant.Id!.Value.ToString())); } var claimsPrincipal = new ClaimsPrincipal(claimsIdentity); using (CurrentPrincipalAccessor.Change(claimsPrincipal)) diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsTokenGrantValidator.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsTokenGrantValidator.cs index fad58ea33..4413faec3 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsTokenGrantValidator.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsTokenGrantValidator.cs @@ -161,7 +161,7 @@ public class SmsTokenGrantValidator : IExtensionGrantValidator await IdentitySecurityLogManager.SaveAsync(logContext); } - protected virtual Task FindClientIdAsync(ExtensionGrantValidationContext context) + protected virtual Task FindClientIdAsync(ExtensionGrantValidationContext context) { return Task.FromResult(context.Request?.Client?.ClientId); } @@ -176,7 +176,7 @@ public class SmsTokenGrantValidator : IExtensionGrantValidator customClaims.Add( new Claim( AbpClaimTypes.TenantId, - user.TenantId?.ToString() + user.TenantId.Value.ToString() ) ); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN/Abp/IdentityServer/WeChat/Work/WeChatWorkGrantValidator.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN/Abp/IdentityServer/WeChat/Work/WeChatWorkGrantValidator.cs index e973db875..45652b2f9 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN/Abp/IdentityServer/WeChat/Work/WeChatWorkGrantValidator.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN/Abp/IdentityServer/WeChat/Work/WeChatWorkGrantValidator.cs @@ -128,7 +128,7 @@ public class WeChatWorkGrantValidator : IExtensionGrantValidator catch (AbpWeChatWorkException wwe) { Logger.LogInformation("Invalid get user info: {message}", wwe.Message); - var error = WeChatWorkLocalizer[wwe.Code]; + var error = WeChatWorkLocalizer[wwe.Code!]; context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, error.ResourceNotFound ? wwe.Code : error.Value); return; } @@ -173,7 +173,7 @@ public class WeChatWorkGrantValidator : IExtensionGrantValidator await IdentitySecurityLogManager.SaveAsync(logContext); } - protected virtual Task FindClientIdAsync(ExtensionGrantValidationContext context) + protected virtual Task FindClientIdAsync(ExtensionGrantValidationContext context) { return Task.FromResult(context.Request?.Client?.ClientId); } @@ -188,7 +188,7 @@ public class WeChatWorkGrantValidator : IExtensionGrantValidator customClaims.Add( new Claim( AbpClaimTypes.TenantId, - user.TenantId?.ToString() + user.TenantId.Value.ToString() ) ); } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateDto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateDto.cs index 9f415caf2..0a3113c7e 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateDto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateDto.cs @@ -7,8 +7,8 @@ public class LanguageCreateDto : LanguageCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxCultureNameLength))] - public string CultureName { get; set; } + public string CultureName { get; set; } = default!; [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxUiCultureNameLength))] - public string UiCultureName { get; set; } + public string? UiCultureName { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateOrUpdateDto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateOrUpdateDto.cs index c1bfc3d0b..fa592e83c 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateOrUpdateDto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateOrUpdateDto.cs @@ -6,5 +6,5 @@ public abstract class LanguageCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageDto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageDto.cs index e5cf660e9..17118a39f 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageDto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageDto.cs @@ -4,8 +4,8 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.LocalizationManagement; public class LanguageDto : AuditedEntityDto { - public string CultureName { get; set; } - public string UiCultureName { get; set; } - public string DisplayName { get; set; } - public string TwoLetterISOLanguageName { get; set; } + public string CultureName { get; set; } = default!; + public string UiCultureName { get; set; } = default!; + public string DisplayName { get; set; } = default!; + public string TwoLetterISOLanguageName { get; set; } = default!; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageGetPagedListInput.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageGetPagedListInput.cs index 22a2ba7e9..03e4ece54 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageGetPagedListInput.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageGetPagedListInput.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.LocalizationManagement; public class LanguageGetPagedListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceCreateDto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceCreateDto.cs index 2ee5c33d9..d00ced178 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceCreateDto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceCreateDto.cs @@ -6,5 +6,5 @@ public class ResourceCreateDto : ResourceCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(ResourceConsts), nameof(ResourceConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceCreateOrUpdateDto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceCreateOrUpdateDto.cs index dd2f251df..464315624 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceCreateOrUpdateDto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceCreateOrUpdateDto.cs @@ -7,11 +7,11 @@ public abstract class ResourceCreateOrUpdateDto public bool Enable { get; set; } = true; [DynamicStringLength(typeof(ResourceConsts), nameof(ResourceConsts.MaxNameLength))] - public string DisplayName { get; set; } + public string? DisplayName { get; set; } [DynamicStringLength(typeof(ResourceConsts), nameof(ResourceConsts.MaxNameLength))] - public string Description { get; set; } + public string? Description { get; set; } [DynamicStringLength(typeof(ResourceConsts), nameof(ResourceConsts.MaxNameLength))] - public string DefaultCultureName { get; set; } + public string? DefaultCultureName { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceDto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceDto.cs index bf2d8f7b6..00f880a72 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceDto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceDto.cs @@ -6,8 +6,8 @@ namespace LINGYUN.Abp.LocalizationManagement; public class ResourceDto : AuditedEntityDto { public bool Enable { get; set; } - public string Name { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } - public string DefaultCultureName { get; set; } + public string Name { get; set; } = default!; + public string? DisplayName { get; set; } + public string? Description { get; set; } + public string? DefaultCultureName { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceGetPagedListInput.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceGetPagedListInput.cs index bac89d2aa..8e376ac8d 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceGetPagedListInput.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ResourceGetPagedListInput.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.LocalizationManagement; public class ResourceGetPagedListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/RestoreDefaultTextInput.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/RestoreDefaultTextInput.cs index 447a1bdd4..a4b0295ab 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/RestoreDefaultTextInput.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/RestoreDefaultTextInput.cs @@ -7,13 +7,13 @@ public class RestoreDefaultTextInput { [Required] [DynamicStringLength(typeof(ResourceConsts), nameof(ResourceConsts.MaxNameLength))] - public string ResourceName { get; set; } + public string ResourceName { get; set; } = default!; [Required] [DynamicStringLength(typeof(TextConsts), nameof(TextConsts.MaxKeyLength))] - public string Key { get; set; } + public string Key { get; set; } = default!; [Required] [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxCultureNameLength))] - public string CultureName { get; set; } + public string CultureName { get; set; } = default!; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/SetTextInput.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/SetTextInput.cs index 3f1d26e4d..070f0f7ff 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/SetTextInput.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/SetTextInput.cs @@ -7,16 +7,16 @@ public class SetTextInput { [Required] [DynamicStringLength(typeof(ResourceConsts), nameof(ResourceConsts.MaxNameLength))] - public string ResourceName { get; set; } + public string ResourceName { get; set; } = default!; [Required] [DynamicStringLength(typeof(TextConsts), nameof(TextConsts.MaxKeyLength))] - public string Key { get; set; } + public string Key { get; set; } = default!; [Required] [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxCultureNameLength))] - public string CultureName { get; set; } + public string CultureName { get; set; } = default!; [DynamicStringLength(typeof(TextConsts), nameof(TextConsts.MaxValueLength))] - public string Value { get; set; } + public string? Value { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDeleteInput.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDeleteInput.cs index ad4e85953..d92365047 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDeleteInput.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDeleteInput.cs @@ -7,13 +7,13 @@ public class TextDeleteInput { [Required] [DynamicStringLength(typeof(ResourceConsts), nameof(ResourceConsts.MaxNameLength))] - public string ResourceName { get; set; } + public string ResourceName { get; set; } = default!; [Required] [DynamicStringLength(typeof(TextConsts), nameof(TextConsts.MaxKeyLength))] - public string Key { get; set; } + public string Key { get; set; } = default!; [Required] [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxCultureNameLength))] - public string CultureName { get; set; } + public string CultureName { get; set; } = default!; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDifferenceDto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDifferenceDto.cs index 5e10f1bb1..04e2530e1 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDifferenceDto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDifferenceDto.cs @@ -2,10 +2,10 @@ public class TextDifferenceDto { - public string CultureName { get; set; } - public string Key { get; set; } - public string Value { get; set; } - public string ResourceName { get; set; } - public string TargetCultureName { get; set; } - public string TargetValue { get; set; } + public string CultureName { get; set; } = default!; + public string Key { get; set; } = default!; + public string? Value { get; set; } + public string ResourceName { get; set; } = default!; + public string TargetCultureName { get; set; } = default!; + public string? TargetValue { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDifferenceGetListInput.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDifferenceGetListInput.cs index e245cb806..7650a2d29 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDifferenceGetListInput.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDifferenceGetListInput.cs @@ -5,14 +5,14 @@ namespace LINGYUN.Abp.LocalizationManagement; public class TextDifferenceGetListInput { [Required] - public string CultureName { get; set; } + public string CultureName { get; set; } = default!; [Required] - public string TargetCultureName { get; set; } + public string TargetCultureName { get; set; } = default!; - public string ResourceName { get; set; } + public string? ResourceName { get; set; } public bool? OnlyNull { get; set; } - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDto.cs index 983a3932a..7873bc51e 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextDto.cs @@ -2,8 +2,8 @@ public class TextDto { - public string Key { get; set; } - public string Value { get; set; } - public string CultureName { get; set; } - public string ResourceName { get; set; } + public string Key { get; set; } = default!; + public string? Value { get; set; } + public string CultureName { get; set; } = default!; + public string ResourceName { get; set; } = default!; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextGetByKeyInput.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextGetByKeyInput.cs index 3b0c2217c..96584b900 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextGetByKeyInput.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/TextGetByKeyInput.cs @@ -5,11 +5,11 @@ namespace LINGYUN.Abp.LocalizationManagement; public class TextGetByKeyInput { [Required] - public string Key { get; set; } + public string Key { get; set; } = default!; [Required] - public string CultureName { get; set; } + public string CultureName { get; set; } = default!; [Required] - public string ResourceName { get; set; } + public string ResourceName { get; set; } = default!; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LanguageAppService.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LanguageAppService.cs index 72daea541..3817a54e3 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LanguageAppService.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LanguageAppService.cs @@ -44,11 +44,10 @@ public class LanguageAppService : LocalizationAppServiceBase, ILanguageAppServic using (CultureHelper.Use(input.CultureName, input.UiCultureName)) { - var language = new Language( GuidGenerator.Create(), input.CultureName, - input.UiCultureName, + input.UiCultureName ?? input.CultureName, input.DisplayName, CultureInfo.CurrentCulture.TwoLetterISOLanguageName); @@ -56,7 +55,7 @@ public class LanguageAppService : LocalizationAppServiceBase, ILanguageAppServic await PublishDynamicLocalizationRefreshEvent(new DynamicLanguageRefreshEventData(language.CultureName)); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(language); } @@ -71,7 +70,7 @@ public class LanguageAppService : LocalizationAppServiceBase, ILanguageAppServic await PublishDynamicLocalizationRefreshEvent(new DynamicLanguageRefreshEventData(language.CultureName)); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(LocalizationManagementPermissions.Language.Update)] @@ -85,7 +84,7 @@ public class LanguageAppService : LocalizationAppServiceBase, ILanguageAppServic await PublishDynamicLocalizationRefreshEvent(new DynamicLanguageRefreshEventData(language.CultureName)); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(language); } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LocalizationAppServiceBase.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LocalizationAppServiceBase.cs index 7e45989bf..3a744253a 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LocalizationAppServiceBase.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LocalizationAppServiceBase.cs @@ -7,15 +7,15 @@ namespace LINGYUN.Abp.LocalizationManagement; public abstract class LocalizationAppServiceBase : ApplicationService { - protected ILocalEventBus LocalEventBus => LazyServiceProvider.LazyGetService(); + protected ILocalEventBus LocalEventBus => LazyServiceProvider.LazyGetRequiredService(); protected LocalizationAppServiceBase() { LocalizationResource = typeof(LocalizationManagementResource); ObjectMapperContext = typeof(AbpLocalizationManagementApplicationModule); } - protected async virtual Task PublishDynamicLocalizationRefreshEvent(TEvent @event) + protected async virtual Task PublishDynamicLocalizationRefreshEvent(TEvent @event) where TEvent : notnull { - await LocalEventBus?.PublishAsync(@event.GetType(), @event); + await LocalEventBus.PublishAsync(@event.GetType(), @event); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/ResourceAppService.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/ResourceAppService.cs index afa38a666..4169f7a85 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/ResourceAppService.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/ResourceAppService.cs @@ -51,7 +51,7 @@ public class ResourceAppService : LocalizationAppServiceBase, IResourceAppServic await PublishDynamicLocalizationRefreshEvent(new DynamicResourceRefreshEventData(resource.Name)); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(resource); } @@ -65,7 +65,7 @@ public class ResourceAppService : LocalizationAppServiceBase, IResourceAppServic await PublishDynamicLocalizationRefreshEvent(new DynamicResourceRefreshEventData(resource.Name)); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(LocalizationManagementPermissions.Resource.Update)] @@ -81,7 +81,7 @@ public class ResourceAppService : LocalizationAppServiceBase, IResourceAppServic await PublishDynamicLocalizationRefreshEvent(new DynamicResourceRefreshEventData(resource.Name)); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(resource); } @@ -92,7 +92,7 @@ public class ResourceAppService : LocalizationAppServiceBase, IResourceAppServic if (!input.Filter.IsNullOrWhiteSpace()) { predicate = predicate.And(x => x.Name.Contains(input.Filter) || - x.DisplayName.Contains(input.Filter) || x.Description.Contains(input.Filter)); + x.DisplayName!.Contains(input.Filter) || x.Description!.Contains(input.Filter)); } var specification = new Volo.Abp.Specifications.ExpressionSpecification(predicate); diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/TextAppService.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/TextAppService.cs index 0b1a296f1..c16587386 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/TextAppService.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/TextAppService.cs @@ -107,7 +107,7 @@ public class TextAppService : LocalizationAppServiceBase, ITextAppService await PublishDynamicLocalizationRefreshEvent(new DynamicTextRefreshEventData(text.ResourceName, text.CultureName)); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(LocalizationManagementPermissions.Text.Delete)] @@ -120,7 +120,7 @@ public class TextAppService : LocalizationAppServiceBase, ITextAppService await PublishDynamicLocalizationRefreshEvent(new DynamicTextRefreshEventData(text.ResourceName, text.CultureName)); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } } @@ -135,7 +135,7 @@ public class TextAppService : LocalizationAppServiceBase, ITextAppService await PublishDynamicLocalizationRefreshEvent(new DynamicTextRefreshEventData(text.ResourceName, text.CultureName)); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerEto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerEto.cs index 1d6fc5dab..942b7b525 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerEto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerEto.cs @@ -2,7 +2,7 @@ public abstract class DynamicLocalizationInitializerEto { - public string[] Keys { get; set; } + public string[] Keys { get; set; } = default!; protected DynamicLocalizationInitializerEto() { diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationRefreshEto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationRefreshEto.cs index 8bacc90e4..cdecf6055 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationRefreshEto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationRefreshEto.cs @@ -2,7 +2,7 @@ public class DynamicLanguageRefreshEventData { - public string CultureName { get; set; } + public string CultureName { get; set; } = default!; public DynamicLanguageRefreshEventData() { @@ -16,7 +16,7 @@ public class DynamicLanguageRefreshEventData public class DynamicResourceRefreshEventData { - public string ResourceName { get; set; } + public string ResourceName { get; set; } = default!; public DynamicResourceRefreshEventData() { @@ -30,8 +30,8 @@ public class DynamicResourceRefreshEventData public class DynamicTextRefreshEventData { - public string ResourceName { get; set; } - public string CultureName { get; set; } + public string ResourceName { get; set; } = default!; + public string CultureName { get; set; } = default!; public DynamicTextRefreshEventData() { diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageEto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageEto.cs index da27c87a2..f65176e39 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageEto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageEto.cs @@ -2,8 +2,8 @@ public class LanguageEto { public bool Enable { get; set; } - public string CultureName { get; set; } - public string UiCultureName { get; set; } - public string DisplayName { get; set; } - public string TwoLetterISOLanguageName { get; set; } + public string CultureName { get; set; } = default!; + public string UiCultureName { get; set; } = default!; + public string DisplayName { get; set; } = default!; + public string TwoLetterISOLanguageName { get; set; } = default!; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceChangedEto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceChangedEto.cs index a12b250b3..c7e17f323 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceChangedEto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceChangedEto.cs @@ -6,6 +6,6 @@ namespace LINGYUN.Abp.LocalizationManagement; [Serializable] public class ResourceChangedEto { - public List Resources { get; set; } - public List Cultures { get; set; } + public List Resources { get; set; } = default!; + public List Cultures { get; set; } = default!; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceEto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceEto.cs index dd2f9d301..99e4876c0 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceEto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceEto.cs @@ -3,8 +3,8 @@ public class ResourceEto { public bool Enable { get; set; } - public string Name { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } - public string DefaultCultureName { get; set; } + public string Name { get; set; } = default!; + public string? DisplayName { get; set; } + public string? Description { get; set; } + public string? DefaultCultureName { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextDifference.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextDifference.cs index 6cf5cb7cf..01a68c159 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextDifference.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextDifference.cs @@ -3,22 +3,22 @@ public class TextDifference { public int Id { get; set; } - public string CultureName { get; set; } - public string Key { get; set; } - public string Value { get; set; } - public string ResourceName { get; set; } - public string TargetCultureName { get; set; } - public string TargetValue { get; set; } + public string CultureName { get; set; } = default!; + public string Key { get; set; } = default!; + public string? Value { get; set; } + public string? ResourceName { get; set; } + public string TargetCultureName { get; set; } = default!; + public string? TargetValue { get; set; } public TextDifference() { } public TextDifference( int id, string cultureName, string key, - string value, + string? value, string targetCultureName, - string targetValue = null, - string resourceName = null) + string? targetValue = null, + string? resourceName = null) { Id = id; Key = key; diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextEto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextEto.cs index f1025f931..7eda7d6a6 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextEto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextEto.cs @@ -2,8 +2,8 @@ public class TextEto { - public string CultureName { get; set; } - public string Key { get; set; } - public string Value { get; set; } - public string ResourceName { get; set; } + public string CultureName { get; set; } = default!; + public string Key { get; set; } = default!; + public string? Value { get; set; } + public string? ResourceName { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationChangedEventHandler.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationChangedEventHandler.cs index e07df6c78..4927aef82 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationChangedEventHandler.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationChangedEventHandler.cs @@ -32,7 +32,7 @@ public class DynamicLocalizationChangedEventHandler : { var resourcesCacheItem = await ResourcesCache.GetAsync(LocalizationResourcesCacheItem.CacheKey); var languagesCacheItem = await LanguageCache.GetAsync(LocalizationLanguageCacheItem.CacheKey); - if (languagesCacheItem == null && resourcesCacheItem == null) + if (languagesCacheItem == null || resourcesCacheItem == null) { return; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerCacheItem.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerCacheItem.cs index b9325f9b8..e1352dac4 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerCacheItem.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerCacheItem.cs @@ -10,10 +10,10 @@ namespace LINGYUN.Abp.LocalizationManagement; [CacheName("DynamicLanguageInitializer")] public class DynamicLanguageInitializerCacheItem { - public string CultureName { get; set; } - public string UiCultureName { get; set; } - public string DisplayName { get; set; } - public string TwoLetterISOLanguageName { get; set; } + public string CultureName { get; set; } = default!; + public string UiCultureName { get; set; } = default!; + public string DisplayName { get; set; } = default!; + public string TwoLetterISOLanguageName { get; set; } = default!; public DynamicLanguageInitializerCacheItem() { } @@ -35,14 +35,14 @@ public class DynamicLanguageInitializerCacheItem [CacheName("DynamicResourceInitializer")] public class DynamicResourceInitializerCacheItem { - public string ResourceName { get; set; } - public string DefaultCultureName { get; set; } + public string ResourceName { get; set; } = default!; + public string? DefaultCultureName { get; set; } public DynamicResourceInitializerCacheItem() { } public DynamicResourceInitializerCacheItem( string resourceName, - string defaultCultureName) + string? defaultCultureName) { ResourceName = resourceName; DefaultCultureName = defaultCultureName; @@ -54,8 +54,8 @@ public class DynamicResourceInitializerCacheItem [CacheName("DynamicTextInitializer")] public class DynamicTextInitializerCacheItem { - public string ResourceName { get; set; } - public string CultureName { get; set; } + public string ResourceName { get; set; } = default!; + public string CultureName { get; set; } = default!; public Dictionary Texts { get; set; } public DynamicTextInitializerCacheItem() { diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerEventHandler.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerEventHandler.cs index e41010160..395b3be4e 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerEventHandler.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/DynamicLocalizationInitializerEventHandler.cs @@ -125,7 +125,7 @@ public class DynamicLocalizationInitializerEventHandler : return; } - await SaveLanguagesAsync(cacheItems.Select(kv => kv.Value).ToArray()); + await SaveLanguagesAsync(cacheItems.Select(kv => kv.Value!).ToArray()); Logger.LogInformation("Refresh language cache items."); await RefreshLanguagesCacheAsync(); @@ -178,7 +178,7 @@ public class DynamicLocalizationInitializerEventHandler : return; } - await SaveResourcesAsync(cacheItems.Select(kv => kv.Value).ToArray()); + await SaveResourcesAsync(cacheItems.Select(kv => kv.Value!).ToArray()); Logger.LogInformation("Refresh resource cache items."); await RefreshResourcesCacheAsync(); @@ -201,7 +201,7 @@ public class DynamicLocalizationInitializerEventHandler : var allTexts = await TextRepository.GetListAsync(eventData.ResourceName, eventData.CultureName); foreach (var text in allTexts) { - setTexts[text.Key] = text.Value; + setTexts[text.Key] = text.Value ?? ""; } var textCacheKey = LocalizationTextCacheItem.CalculateCacheKey(eventData.ResourceName, eventData.CultureName); @@ -242,10 +242,10 @@ public class DynamicLocalizationInitializerEventHandler : return; } - await SaveTextsAsync(cacheItems); + await SaveTextsAsync(cacheItems!); Logger.LogInformation("Refresh text cache items."); - await RefreshTextsCacheAsync(cacheItems); + await RefreshTextsCacheAsync(cacheItems!); await DynamicResourceCache.RemoveManyAsync(eventData.Keys); @@ -433,7 +433,7 @@ public class DynamicLocalizationInitializerEventHandler : var allTexts = await TextRepository.GetListAsync(cacheItem.ResourceName, cacheItem.CultureName); foreach (var text in allTexts) { - setTexts[text.Key] = text.Value; + setTexts[text.Key] = text.Value ?? ""; } var textCacheKey = LocalizationTextCacheItem.CalculateCacheKey(cacheItem.ResourceName, cacheItem.CultureName); diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationResourceContributor.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationResourceContributor.cs index 02791a5e8..9ca2d64fd 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationResourceContributor.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationResourceContributor.cs @@ -11,9 +11,9 @@ public class ExternalLocalizationResourceContributor : ILocalizationResourceCont { public bool IsDynamic => false; - protected LocalizationResourceBase Resource { get; private set; } - protected IExternalLocalizationStoreCache StoreCache { get; private set; } - protected IExternalLocalizationTextStoreCache TextStoreCache { get; private set; } + protected LocalizationResourceBase Resource { get; private set; } = default!; + protected IExternalLocalizationStoreCache StoreCache { get; private set; } = default!; + protected IExternalLocalizationTextStoreCache TextStoreCache { get; private set; } = default!; public virtual void Fill(string cultureName, Dictionary dictionary) { @@ -35,7 +35,7 @@ public class ExternalLocalizationResourceContributor : ILocalizationResourceCont } } - public virtual LocalizedString GetOrNull(string cultureName, string name) + public virtual LocalizedString? GetOrNull(string cultureName, string name) { var texts = TextStoreCache.GetTexts(Resource, cultureName); @@ -54,10 +54,10 @@ public class ExternalLocalizationResourceContributor : ILocalizationResourceCont if (cacheItem == null || !cacheItem.IsEnabled) { - return Array.Empty(); + return []; } - return cacheItem.SupportedCultures; + return cacheItem.SupportedCultures ?? []; } public void Initialize(LocalizationResourceInitializationContext context) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationStore.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationStore.cs index cff5a80a9..0a454b0d3 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationStore.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationStore.cs @@ -22,7 +22,7 @@ public class ExternalLocalizationStore : IExternalLocalizationStore, ITransientD StoreCache = storeCache; } - public virtual LocalizationResourceBase GetResourceOrNull(string resourceName) + public virtual LocalizationResourceBase? GetResourceOrNull(string resourceName) { var cacheItem = StoreCache.GetResourceOrNull(resourceName); @@ -34,7 +34,7 @@ public class ExternalLocalizationStore : IExternalLocalizationStore, ITransientD return CreateNonTypedLocalizationResource(cacheItem); } - public async virtual Task GetResourceOrNullAsync(string resourceName) + public async virtual Task GetResourceOrNullAsync(string resourceName) { var cacheItem = await StoreCache.GetResourceOrNullAsync(resourceName); @@ -78,7 +78,7 @@ public class ExternalLocalizationStore : IExternalLocalizationStore, ITransientD cacheItem.Name, cacheItem.DefaultCulture); - if (cacheItem.BaseResources.Length > 0) + if (cacheItem.BaseResources?.Length > 0) { localizationResource.AddBaseResources(cacheItem.BaseResources); } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationStoreCache.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationStoreCache.cs index 3cc690608..6e06dd2ea 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationStoreCache.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationStoreCache.cs @@ -27,21 +27,21 @@ public class ExternalLocalizationStoreCache : IExternalLocalizationStoreCache, I { var cacheItem = await ResourcesCache.GetAsync(LocalizationResourcesCacheItem.CacheKey); - return cacheItem.Resources + return cacheItem?.Resources .Where(x => x.IsEnabled) .Where(x => !LocalizationOptions.Resources.ContainsKey(x.Name)) .Select(x => x.Name) - .ToArray(); + .ToArray() ?? []; } - public virtual LocalizationResourceCacheItem GetResourceOrNull(string resourceName) + public virtual LocalizationResourceCacheItem? GetResourceOrNull(string resourceName) { var cacheItem = ResourceCache.Get(resourceName); return cacheItem?.IsEnabled == true ? cacheItem : null; } - public async virtual Task GetResourceOrNullAsync(string resourceName) + public async virtual Task GetResourceOrNullAsync(string resourceName) { var cacheItem = await ResourceCache.GetAsync(resourceName); @@ -55,6 +55,6 @@ public class ExternalLocalizationStoreCache : IExternalLocalizationStoreCache, I return cacheItem?.Resources .Where(x => x.IsEnabled) .Where(x => !LocalizationOptions.Resources.ContainsKey(x.Name)) - .ToArray(); + .ToArray() ?? []; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStampCacheItem.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStampCacheItem.cs index 434063dad..10357aab1 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStampCacheItem.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStampCacheItem.cs @@ -10,7 +10,7 @@ namespace LINGYUN.Abp.LocalizationManagement.External; public class ExternalLocalizationTextStampCacheItem { private const string CacheKeyFormat = "r:{0},c:{1}"; - public string Stamp { get; set; } + public string Stamp { get; set; } = default!; public ExternalLocalizationTextStampCacheItem() { diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStoreCache.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStoreCache.cs index 37a72f62a..d7233d530 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStoreCache.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStoreCache.cs @@ -96,7 +96,7 @@ public class ExternalLocalizationTextStoreCache : IExternalLocalizationTextStore await GetAndRefreshMemoryCacheItemAsync(resourceName, cultureName); } - protected async virtual Task GetAndRefreshMemoryCacheItemAsync(string resourceName, string cultureName) + protected async virtual Task GetAndRefreshMemoryCacheItemAsync(string resourceName, string cultureName) { var cacheKey = ExternalLocalizationTextCacheItem.CalculateCacheKey(resourceName, cultureName); var cacheItem = await DistributedCache.GetAsync(cacheKey); diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/IExternalLocalizationStoreCache.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/IExternalLocalizationStoreCache.cs index 37622b100..e3c751137 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/IExternalLocalizationStoreCache.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/IExternalLocalizationStoreCache.cs @@ -4,9 +4,9 @@ namespace LINGYUN.Abp.LocalizationManagement.External; public interface IExternalLocalizationStoreCache { - LocalizationResourceCacheItem GetResourceOrNull(string resourceName); + LocalizationResourceCacheItem? GetResourceOrNull(string resourceName); - Task GetResourceOrNullAsync(string resourceName); + Task GetResourceOrNullAsync(string resourceName); Task GetResourceNamesAsync(); diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationResourceCacheItem.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationResourceCacheItem.cs index db983834a..7ee1c1604 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationResourceCacheItem.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationResourceCacheItem.cs @@ -8,13 +8,13 @@ namespace LINGYUN.Abp.LocalizationManagement.External; [CacheName("AbpExternalLocalizationResource")] public class LocalizationResourceCacheItem { - public virtual string Name { get; set; } + public virtual string Name { get; set; } = default!; - public virtual string DefaultCulture { get; set; } + public virtual string? DefaultCulture { get; set; } - public virtual string[] BaseResources { get; set; } + public virtual string[]? BaseResources { get; set; } - public virtual string[] SupportedCultures { get; set; } + public virtual string[]? SupportedCultures { get; set; } public bool IsEnabled { get; set; } @@ -25,9 +25,9 @@ public class LocalizationResourceCacheItem public LocalizationResourceCacheItem( string name, - string defaultCulture = null, - string[] baseResources = null, - string[] supportedCultures = null) + string? defaultCulture = null, + string[]? baseResources = null, + string[]? supportedCultures = null) { Name = name; DefaultCulture = defaultCulture; diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationResourcesCacheItem.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationResourcesCacheItem.cs index 91bbf3c5f..e795f26ed 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationResourcesCacheItem.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationResourcesCacheItem.cs @@ -23,7 +23,7 @@ public class LocalizationResourcesCacheItem Resources = resources; } - public LocalizationResourceCacheItem GetResourceOrNull(string name) + public LocalizationResourceCacheItem? GetResourceOrNull(string name) { return Resources?.FirstOrDefault(x => x.Name == name); } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationTextMemoryCacheItem.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationTextMemoryCacheItem.cs index 58fd8fb85..3a5371d9e 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationTextMemoryCacheItem.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/LocalizationTextMemoryCacheItem.cs @@ -7,7 +7,7 @@ public class LocalizationTextMemoryCacheItem { private const string CacheKeyFormat = "r:{0},c:{1}"; - public string CacheStamp { get; } + public string CacheStamp { get; } = default!; public DateTime LastCheckTime { get; set; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILanguageRepository.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILanguageRepository.cs index 0ec0428e4..787202a1c 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILanguageRepository.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILanguageRepository.cs @@ -9,7 +9,7 @@ namespace LINGYUN.Abp.LocalizationManagement; public interface ILanguageRepository : IRepository { - Task FindByCultureNameAsync( + Task FindByCultureNameAsync( string cultureName, CancellationToken cancellationToken = default); @@ -22,7 +22,7 @@ public interface ILanguageRepository : IRepository Task> GetListAsync( ISpecification specification, - string sorting = nameof(Language.CultureName), + string? sorting = nameof(Language.CultureName), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILocalizationTextStoreCache.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILocalizationTextStoreCache.cs index 6ae9fa45b..09323112f 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILocalizationTextStoreCache.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILocalizationTextStoreCache.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.LocalizationManagement; public interface ILocalizationTextStoreCache { - LocalizedString GetOrNull(LocalizationResourceBase resource, string cultureName, string name); + LocalizedString? GetOrNull(LocalizationResourceBase resource, string cultureName, string name); void Fill(LocalizationResourceBase resource, string cultureName, Dictionary dictionary); diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/IResourceRepository.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/IResourceRepository.cs index fb86ba7bd..57713ab72 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/IResourceRepository.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/IResourceRepository.cs @@ -13,9 +13,9 @@ public interface IResourceRepository : IRepository string name, CancellationToken cancellationToken = default); - Resource FindByName(string name); + Resource? FindByName(string name); - Task FindByNameAsync( + Task FindByNameAsync( string name, CancellationToken cancellationToken = default); @@ -28,7 +28,7 @@ public interface IResourceRepository : IRepository Task> GetListAsync( ISpecification specification, - string sorting = nameof(Resource.Name), + string? sorting = nameof(Resource.Name), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ITextRepository.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ITextRepository.cs index 5f6ddf097..01dfbd92f 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ITextRepository.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ITextRepository.cs @@ -14,7 +14,7 @@ namespace LINGYUN.Abp.LocalizationManagement IEnumerable keys, CancellationToken cancellationToken = default); - Task GetByCultureKeyAsync( + Task GetByCultureKeyAsync( string resourceName, string cultureName, string key, @@ -23,12 +23,12 @@ namespace LINGYUN.Abp.LocalizationManagement [Obsolete("Use GetListAsync")] List GetList( - string resourceName = null, - string cultureName = null); + string? resourceName = null, + string? cultureName = null); Task> GetListAsync( - string resourceName = null, - string cultureName = null, + string? resourceName = null, + string? cultureName = null, CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Language.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Language.cs index bd61d08e9..b9f0d0fb3 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Language.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Language.cs @@ -9,17 +9,17 @@ namespace LINGYUN.Abp.LocalizationManagement; public class Language : AuditedEntity, ILanguageInfo { public virtual bool Enable { get; set; } - public virtual string CultureName { get; protected set; } - public virtual string UiCultureName { get; protected set; } - public virtual string DisplayName { get; protected set; } - public virtual string TwoLetterISOLanguageName { get; set; } + public virtual string CultureName { get; protected set; } = default!; + public virtual string UiCultureName { get; protected set; } = default!; + public virtual string DisplayName { get; protected set; } = default!; + public virtual string? TwoLetterISOLanguageName { get; set; } protected Language() { } public Language( Guid id, [NotNull] string cultureName, [NotNull] string uiCultureName, [NotNull] string displayName, - string twoLetterISOLanguageName = null) + string? twoLetterISOLanguageName = null) : base(id) { CultureName = Check.NotNullOrWhiteSpace(cultureName, nameof(cultureName), LanguageConsts.MaxCultureNameLength); @@ -40,21 +40,21 @@ public class Language : AuditedEntity, ILanguageInfo TwoLetterISOLanguageName = Check.Length(twoLetterISOLanguageName, nameof(twoLetterISOLanguageName), LanguageConsts.MaxTwoLetterISOLanguageNameLength); } - public virtual void ChangeCulture(string cultureName, string uiCultureName = null, string displayName = null) + public virtual void ChangeCulture(string cultureName, string? uiCultureName = null, string? displayName = null) { ChangeCultureInternal(cultureName, uiCultureName, displayName); } - private void ChangeCultureInternal(string cultureName, string uiCultureName, string displayName) + private void ChangeCultureInternal(string cultureName, string? uiCultureName, string? displayName) { CultureName = Check.NotNullOrWhiteSpace(cultureName, nameof(cultureName), LanguageConsts.MaxCultureNameLength); UiCultureName = !uiCultureName.IsNullOrWhiteSpace() - ? Check.Length(uiCultureName, nameof(uiCultureName), LanguageConsts.MaxUiCultureNameLength) + ? Check.Length(uiCultureName, nameof(uiCultureName), LanguageConsts.MaxUiCultureNameLength)! : cultureName; DisplayName = !displayName.IsNullOrWhiteSpace() - ? Check.Length(displayName, nameof(displayName), LanguageConsts.MaxDisplayNameLength) + ? Check.Length(displayName, nameof(displayName), LanguageConsts.MaxDisplayNameLength)! : cultureName; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationDbProperties.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationDbProperties.cs index 8773227e8..6bfa310d9 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationDbProperties.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationDbProperties.cs @@ -4,7 +4,7 @@ public static class LocalizationDbProperties { public static string DbTablePrefix { get; set; } = "AbpLocalization"; - public static string DbSchema { get; set; } = null; + public static string? DbSchema { get; set; } = null; public const string ConnectionStringName = "AbpLocalizationManagement"; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationLanguageCacheItem.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationLanguageCacheItem.cs index 3c19db655..407792a0b 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationLanguageCacheItem.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationLanguageCacheItem.cs @@ -12,7 +12,7 @@ namespace LINGYUN.Abp.LocalizationManagement; public class LocalizationLanguageCacheItem { public const string CacheKey = "All"; - public List Languages { get; set; } + public List Languages { get; set; } = default!; public LocalizationLanguageCacheItem() { diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationResourceContributor.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationResourceContributor.cs index 63d811c80..b466f3413 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationResourceContributor.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationResourceContributor.cs @@ -10,9 +10,9 @@ namespace LINGYUN.Abp.LocalizationManagement; public class LocalizationResourceContributor : ILocalizationResourceContributor { public bool IsDynamic => true; - protected LocalizationResourceBase Resource { get; private set; } - protected ILocalizationTextStoreCache LocalizationTextStoreCache { get; private set; } - protected ILocalizationLanguageStoreCache LocalizationLanguageStoreCache { get; private set; } + protected LocalizationResourceBase Resource { get; private set; } = default!; + protected ILocalizationTextStoreCache LocalizationTextStoreCache { get; private set; } = default!; + protected ILocalizationLanguageStoreCache LocalizationLanguageStoreCache { get; private set; } = default!; public virtual void Fill(string cultureName, Dictionary dictionary) { @@ -24,7 +24,7 @@ public class LocalizationResourceContributor : ILocalizationResourceContributor await LocalizationTextStoreCache.FillAsync(Resource, cultureName, dictionary); } - public virtual LocalizedString GetOrNull(string cultureName, string name) + public virtual LocalizedString? GetOrNull(string cultureName, string name) { return LocalizationTextStoreCache.GetOrNull(Resource, cultureName, name); } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationTextCacheItem.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationTextCacheItem.cs index 31a7ff05c..7ee6bc638 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationTextCacheItem.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationTextCacheItem.cs @@ -11,8 +11,8 @@ namespace LINGYUN.Abp.LocalizationManagement; public class LocalizationTextCacheItem { private const string CacheKeyFormat = "r:{0},c:{1}"; - public string ResourceName { get; set; } - public string CultureName { get; set; } + public string ResourceName { get; set; } = default!; + public string CultureName { get; set; } = default!; public Dictionary Texts { get; set; } public LocalizationTextCacheItem() { diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationTextStoreCache.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationTextStoreCache.cs index 9dd0414a4..d1f3f4e82 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationTextStoreCache.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationTextStoreCache.cs @@ -45,7 +45,7 @@ public class LocalizationTextStoreCache : ILocalizationTextStoreCache, ISingleto } } - public virtual LocalizedString GetOrNull(LocalizationResourceBase resource, string cultureName, string name) + public virtual LocalizedString? GetOrNull(LocalizationResourceBase resource, string cultureName, string name) { if (_staticCache.TryGetValue(resource.ResourceName, out var cultureLocalCache) && cultureLocalCache.TryGetValue(cultureName, out var textLocalCache)) @@ -79,7 +79,7 @@ public class LocalizationTextStoreCache : ILocalizationTextStoreCache, ISingleto } } - protected async virtual Task GetCacheItemAsync(string resourceName, string cultureName) + protected async virtual Task GetCacheItemAsync(string resourceName, string cultureName) { var cacheKey = LocalizationTextCacheItem.CalculateCacheKey(resourceName, cultureName); return await LocalizationTextCache.GetAsync(cacheKey); diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Resource.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Resource.cs index b8c6c0d27..caa6ffe97 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Resource.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Resource.cs @@ -8,17 +8,17 @@ namespace LINGYUN.Abp.LocalizationManagement; public class Resource : AuditedEntity { public virtual bool Enable { get; set; } - public virtual string Name { get; set; } - public virtual string DisplayName { get; set; } - public virtual string Description { get; set; } - public virtual string DefaultCultureName { get; set; } + public virtual string Name { get; set; } = default!; + public virtual string? DisplayName { get; set; } + public virtual string? Description { get; set; } + public virtual string? DefaultCultureName { get; set; } protected Resource() { } public Resource( Guid id, [NotNull] string name, - [CanBeNull] string displayName = null, - [CanBeNull] string description = null, - [CanBeNull] string defaultCultureName = null) + [CanBeNull] string? displayName = null, + [CanBeNull] string? description = null, + [CanBeNull] string? defaultCultureName = null) : base(id) { Name = Check.NotNullOrWhiteSpace(name, nameof(name), ResourceConsts.MaxNameLength); @@ -30,17 +30,17 @@ public class Resource : AuditedEntity Enable = true; } - public virtual void SetDisplayName(string displayName) + public virtual void SetDisplayName(string? displayName) { DisplayName = Check.Length(displayName, nameof(displayName), ResourceConsts.MaxDisplayNameLength); } - public virtual void SetDescription(string description) + public virtual void SetDescription(string? description) { Description = Check.Length(description, nameof(description), ResourceConsts.MaxDescriptionLength); } - public virtual void SetDefaultCultureName(string defaultCultureName) + public virtual void SetDefaultCultureName(string? defaultCultureName) { DefaultCultureName = Check.Length(defaultCultureName, nameof(defaultCultureName), ResourceConsts.MaxDefaultCultureNameLength); } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Text.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Text.cs index a513bb2b7..6de313245 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Text.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Text.cs @@ -7,30 +7,30 @@ namespace LINGYUN.Abp.LocalizationManagement; public class Text : Entity { - public virtual string CultureName { get; protected set; } - public virtual string Key { get; protected set; } - public virtual string Value { get; protected set; } - public virtual string ResourceName { get; protected set; } + public virtual string CultureName { get; protected set; } = default!; + public virtual string Key { get; protected set; } = default!; + public virtual string? Value { get; protected set; } + public virtual string ResourceName { get; protected set; } = default!; protected Text() { } public Text( [NotNull] string resourceName, [NotNull] string cultureName, [NotNull] string key, - [CanBeNull] string value) + [CanBeNull] string? value = null) { ResourceName = Check.NotNull(resourceName, nameof(resourceName), ResourceConsts.MaxNameLength); CultureName = Check.NotNullOrWhiteSpace(cultureName, nameof(cultureName), LanguageConsts.MaxCultureNameLength); Key = Check.NotNullOrWhiteSpace(key, nameof(key), TextConsts.MaxKeyLength); Value = !value.IsNullOrWhiteSpace() - ? Check.NotNullOrWhiteSpace(value, nameof(value), TextConsts.MaxValueLength) + ? Check.Length(value, nameof(value), TextConsts.MaxValueLength) : ""; } - public void SetValue(string value) + public void SetValue(string? value) { Value = !value.IsNullOrWhiteSpace() - ? Check.NotNullOrWhiteSpace(value, nameof(value), TextConsts.MaxValueLength) + ? Check.Length(value, nameof(value), TextConsts.MaxValueLength) : Value; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreLanguageRepository.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreLanguageRepository.cs index c960b426c..c9916a87c 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreLanguageRepository.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreLanguageRepository.cs @@ -19,7 +19,7 @@ public class EfCoreLanguageRepository : EfCoreRepository FindByCultureNameAsync( + public async virtual Task FindByCultureNameAsync( string cultureName, CancellationToken cancellationToken = default) { @@ -44,7 +44,7 @@ public class EfCoreLanguageRepository : EfCoreRepository> GetListAsync( ISpecification specification, - string sorting = nameof(Language.CultureName), + string? sorting = nameof(Language.CultureName), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreResourceRepository.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreResourceRepository.cs index 02ee4919a..66cd2bbb6 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreResourceRepository.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreResourceRepository.cs @@ -28,7 +28,7 @@ public class EfCoreResourceRepository : EfCoreRepository FindByNameAsync( + public async virtual Task FindByNameAsync( string name, CancellationToken cancellationToken = default) { @@ -61,7 +61,7 @@ public class EfCoreResourceRepository : EfCoreRepository> GetListAsync( ISpecification specification, - string sorting = nameof(Resource.Name), + string? sorting = nameof(Resource.Name), int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreTextRepository.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreTextRepository.cs index af22207b1..484164fc8 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreTextRepository.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreTextRepository.cs @@ -32,7 +32,7 @@ public class EfCoreTextRepository : EfCoreRepository GetByCultureKeyAsync( + public async virtual Task GetByCultureKeyAsync( string resourceName, string cultureName, string key, @@ -47,9 +47,9 @@ public class EfCoreTextRepository : EfCoreRepository GetDifferenceCountAsync( string cultureName, string targetCultureName, - string resourceName = null, + string? resourceName = null, bool? onlyNull = null, - string filter = null, + string? filter = null, CancellationToken cancellationToken = default) { return await (await BuildTextDifferenceQueryAsync( @@ -62,7 +62,7 @@ public class EfCoreTextRepository : EfCoreRepository GetList(string resourceName = null, string cultureName = null) + public virtual List GetList(string? resourceName = null, string? cultureName = null) { return DbSet .WhereIf(!resourceName.IsNullOrWhiteSpace(), x => x.ResourceName.Equals(resourceName)) @@ -71,8 +71,8 @@ public class EfCoreTextRepository : EfCoreRepository> GetListAsync( - string resourceName = null, - string cultureName = null, + string? resourceName = null, + string? cultureName = null, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) @@ -84,9 +84,9 @@ public class EfCoreTextRepository : EfCoreRepository> GetDifferencePagedListAsync( string cultureName, string targetCultureName, - string resourceName = null, + string? resourceName = null, bool? onlyNull = null, - string filter = null, + string? filter = null, string sorting = nameof(TextDifference.Key), int skipCount = 1, int maxResultCount = 10, @@ -106,9 +106,9 @@ public class EfCoreTextRepository : EfCoreRepository> BuildTextDifferenceQueryAsync( string cultureName, string targetCultureName, - string resourceName = null, + string? resourceName = null, bool? onlyNull = null, - string filter = null, + string? filter = null, string sorting = nameof(TextDifference.Key)) { if (sorting.IsNullOrWhiteSpace()) @@ -119,7 +119,7 @@ public class EfCoreTextRepository : EfCoreRepository x.CultureName.Equals(cultureName)) .WhereIf(!resourceName.IsNullOrWhiteSpace(), x => x.ResourceName.Equals(resourceName)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Key.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Key.Contains(filter!)) .OrderBy(sorting); var targetTextQuery = (await GetDbSetAsync()) diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContextModelBuilderExtensions.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContextModelBuilderExtensions.cs index d7aa67089..b29916e85 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContextModelBuilderExtensions.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContextModelBuilderExtensions.cs @@ -9,7 +9,7 @@ public static class LocalizationDbContextModelBuilderExtensions { public static void ConfigureLocalization( this ModelBuilder builder, - Action optionsAction = null) + Action? optionsAction = null) { Check.NotNull(builder, nameof(builder)); diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationModelBuilderConfigurationOptions.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationModelBuilderConfigurationOptions.cs index 48b5dd101..073ade307 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationModelBuilderConfigurationOptions.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationModelBuilderConfigurationOptions.cs @@ -7,7 +7,7 @@ public class LocalizationModelBuilderConfigurationOptions : AbpModelBuilderConfi { public LocalizationModelBuilderConfigurationOptions( [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) + [CanBeNull] string? schema = null) : base( tablePrefix, schema) diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationCreateDto.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationCreateDto.cs index c4f5653ed..cc62be2f7 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationCreateDto.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationCreateDto.cs @@ -10,5 +10,5 @@ public class OpenIddictApplicationCreateDto : OpenIddictApplicationCreateOrUpdat { [Required] [DynamicStringLength(typeof(OpenIddictApplicationConsts), nameof(OpenIddictApplicationConsts.ClientIdMaxLength))] - public string ClientId { get; set; } + public string ClientId { get; set; } = default!; } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationCreateOrUpdateDto.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationCreateOrUpdateDto.cs index 104e153fb..dfd3e75cc 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationCreateOrUpdateDto.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationCreateOrUpdateDto.cs @@ -9,15 +9,15 @@ namespace LINGYUN.Abp.OpenIddict.Applications; public abstract class OpenIddictApplicationCreateOrUpdateDto : ExtensibleObject { [DisableAuditing] - public string ClientSecret { get; set; } + public string? ClientSecret { get; set; } [DynamicStringLength(typeof(OpenIddictApplicationConsts), nameof(OpenIddictApplicationConsts.ClientTypeMaxLength))] - public string ClientType { get; set; } + public string? ClientType { get; set; } [DynamicStringLength(typeof(OpenIddictApplicationConsts), nameof(OpenIddictApplicationConsts.ConsentTypeMaxLength))] - public string ConsentType { get; set; } + public string? ConsentType { get; set; } - public string DisplayName { get; set; } + public string? DisplayName { get; set; } public Dictionary DisplayNames { get; set; } = new Dictionary(); @@ -37,11 +37,11 @@ public abstract class OpenIddictApplicationCreateOrUpdateDto : ExtensibleObject public OpenIddictApplicationSettingsDto Settings { get; set; } = new OpenIddictApplicationSettingsDto(); [DynamicStringLength(typeof(OpenIddictApplicationConsts), nameof(OpenIddictApplicationConsts.ApplicationTypeMaxLength))] - public string ApplicationType { get; set; } + public string? ApplicationType { get; set; } - public string ClientUri { get; set; } + public string? ClientUri { get; set; } - public string LogoUri { get; set; } + public string? LogoUri { get; set; } - public string FrontChannelLogoutUri { get; set; } + public string? FrontChannelLogoutUri { get; set; } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationDto.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationDto.cs index c5401b022..36f12d1a7 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationDto.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationDto.cs @@ -8,10 +8,10 @@ namespace LINGYUN.Abp.OpenIddict.Applications; [Serializable] public class OpenIddictApplicationDto : ExtensibleAuditedEntityDto, IHasConcurrencyStamp { - public string ClientId { get; set; } - public string ClientType { get; set; } - public string ConsentType { get; set; } - public string DisplayName { get; set; } + public string? ClientId { get; set; } + public string? ClientType { get; set; } + public string? ConsentType { get; set; } + public string? DisplayName { get; set; } public Dictionary DisplayNames { get; set; } = new Dictionary(); public List Endpoints { get; set; } = new List(); public List GrantTypes { get; set; } = new List(); @@ -22,10 +22,10 @@ public class OpenIddictApplicationDto : ExtensibleAuditedEntityDto, IHasCo public List RedirectUris { get; set; } = new List(); public OpenIddictApplicationRequirementsDto Requirements { get; set; } = new OpenIddictApplicationRequirementsDto(); public OpenIddictApplicationSettingsDto Settings { get; set; } = new OpenIddictApplicationSettingsDto(); - public string ApplicationType { get; set; } - public string ClientUri { get; set; } - public string LogoUri { get; set; } - public string JsonWebKeySet { get; set; } - public string ConcurrencyStamp { get; set; } - public string FrontChannelLogoutUri { get; set; } + public string? ApplicationType { get; set; } + public string? ClientUri { get; set; } + public string? LogoUri { get; set; } + public string? JsonWebKeySet { get; set; } + public string ConcurrencyStamp { get; set; } = default!; + public string? FrontChannelLogoutUri { get; set; } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationGetListInput.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationGetListInput.cs index 8dc3d10c8..e1ee32631 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationGetListInput.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationGetListInput.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.OpenIddict.Applications; [Serializable] public class OpenIddictApplicationGetListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationUpdateDto.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationUpdateDto.cs index 226d90a3c..001d6daa6 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationUpdateDto.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationUpdateDto.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.OpenIddict.Applications; [Serializable] public class OpenIddictApplicationUpdateDto : OpenIddictApplicationCreateOrUpdateDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationDto.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationDto.cs index ba2f0cbe1..547cc6f21 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationDto.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationDto.cs @@ -8,12 +8,12 @@ namespace LINGYUN.Abp.OpenIddict.Authorizations; [Serializable] public class OpenIddictAuthorizationDto : ExtensibleEntityDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; public Guid? ApplicationId { get; set; } public DateTime? CreationDate { get; set; } public Dictionary Properties { get; set; } = new Dictionary(); public List Scopes { get; set; } = new List(); - public string Status { get; set; } - public string Subject { get; set; } - public string Type { get; set; } + public string? Status { get; set; } + public string? Subject { get; set; } + public string? Type { get; set; } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationGetListInput.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationGetListInput.cs index 38a04e19d..03601d4ad 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationGetListInput.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationGetListInput.cs @@ -6,11 +6,11 @@ namespace LINGYUN.Abp.OpenIddict.Authorizations; [Serializable] public class OpenIddictAuthorizationGetListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } - public string Subject { get; set; } + public string? Filter { get; set; } + public string? Subject { get; set; } public Guid? ClientId { get; set; } - public string Status { get; set; } - public string Type { get; set; } + public string? Status { get; set; } + public string? Type { get; set; } public DateTime? BeginCreationTime { get; set; } public DateTime? EndCreationTime { get; set; } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeCreateOrUpdateDto.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeCreateOrUpdateDto.cs index 1affce2a1..cd4220ed2 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeCreateOrUpdateDto.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeCreateOrUpdateDto.cs @@ -9,17 +9,17 @@ namespace LINGYUN.Abp.OpenIddict.Scopes; public abstract class OpenIddictScopeCreateOrUpdateDto : ExtensibleObject { - public string Description { get; set; } + public string? Description { get; set; } public Dictionary Descriptions { get; set; } = new Dictionary(); - public string DisplayName { get; set; } + public string? DisplayName { get; set; } public Dictionary DisplayNames { get; set; } = new Dictionary(); [Required] [DynamicStringLength(typeof(OpenIddictScopeConsts), nameof(OpenIddictScopeConsts.NameMaxLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; public Dictionary Properties { get; set; } = new Dictionary(); diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeDto.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeDto.cs index eb37c9199..45887bc05 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeDto.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeDto.cs @@ -8,20 +8,20 @@ namespace LINGYUN.Abp.OpenIddict.Scopes; [Serializable] public class OpenIddictScopeDto : ExtensibleAuditedEntityDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; - public string Description { get; set; } + public string? Description { get; set; } public Dictionary Descriptions { get; set; } = new Dictionary(); - public string DisplayName { get; set; } + public string? DisplayName { get; set; } public Dictionary DisplayNames { get; set; } = new Dictionary(); - public string Name { get; set; } + public string? Name { get; set; } public Dictionary Properties { get; set; } = new Dictionary(); - public List Resources { get; set; } + public List Resources { get; set; } = new List(); } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeGetListInput.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeGetListInput.cs index c16c6a8b1..2633ad87f 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeGetListInput.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeGetListInput.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.OpenIddict.Scopes; [Serializable] public class OpenIddictScopeGetListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeUpdateDto.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeUpdateDto.cs index d04095409..aedb98d1d 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeUpdateDto.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeUpdateDto.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.OpenIddict.Scopes; [Serializable] public class OpenIddictScopeUpdateDto : OpenIddictScopeCreateOrUpdateDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenDto.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenDto.cs index d89babebb..99b4ddb4b 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenDto.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenDto.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Entities; @@ -7,7 +8,7 @@ namespace LINGYUN.Abp.OpenIddict.Tokens; [Serializable] public class OpenIddictTokenDto : ExtensibleEntityDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; public Guid? ApplicationId { get; set; } @@ -17,17 +18,17 @@ public class OpenIddictTokenDto : ExtensibleEntityDto, IHasConcurrencyStam public DateTime? ExpirationDate { get; set; } - public string Payload { get; set; } + public string? Payload { get; set; } - public string Properties { get; set; } + public Dictionary Properties { get; set; } = new Dictionary(); public DateTime? RedemptionDate { get; set; } - public string ReferenceId { get; set; } + public string? ReferenceId { get; set; } - public string Status { get; set; } + public string? Status { get; set; } - public string Subject { get; set; } + public string? Subject { get; set; } - public string Type { get; set; } + public string? Type { get; set; } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenGetListInput.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenGetListInput.cs index 71c12c418..7b1061e57 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenGetListInput.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenGetListInput.cs @@ -6,13 +6,13 @@ namespace LINGYUN.Abp.OpenIddict.Tokens; [Serializable] public class OpenIddictTokenGetListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } public Guid? ClientId { get; set; } public Guid? AuthorizationId { get; set; } - public string Subject { get; set; } - public string Status { get; set; } - public string Type { get; set; } - public string ReferenceId { get; set; } + public string? Subject { get; set; } + public string? Status { get; set; } + public string? Type { get; set; } + public string? ReferenceId { get; set; } public DateTime? BeginExpirationDate { get; set; } public DateTime? EndExpirationDate { get; set; } public DateTime? BeginCreationTime { get; set; } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationAppService.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationAppService.cs index b6bcd5edf..d009cf3af 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationAppService.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationAppService.cs @@ -88,7 +88,7 @@ public class OpenIddictApplicationAppService : OpenIddictApplicationServiceBase, await _applicationManager.UpdateAsync(application.ToModel(), input.ClientSecret); } - application = await _applicationRepository.FindAsync(id); + application = await _applicationRepository.GetAsync(id); return application.ToDto(JsonSerializer); } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationExtensions.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationExtensions.cs index d895736e1..00565da59 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationExtensions.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Applications/OpenIddictApplicationExtensions.cs @@ -79,7 +79,7 @@ internal static class OpenIddictApplicationExtensions return entity; } - public static OpenIddictApplicationDto ToDto(this OpenIddictApplication entity, IJsonSerializer jsonSerializer) + public static OpenIddictApplicationDto? ToDto(this OpenIddictApplication entity, IJsonSerializer jsonSerializer) { if (entity == null) { diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationAppService.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationAppService.cs index f23c53d74..815804b50 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationAppService.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationAppService.cs @@ -34,14 +34,14 @@ public class OpenIddictAuthorizationAppService : OpenIddictApplicationServiceBas { var authorization = await _authorizationManager.FindByIdAsync(_identifierConverter.ToString(id)); - await _authorizationManager.DeleteAsync(authorization); + await _authorizationManager.DeleteAsync(authorization!); } public async virtual Task GetAsync(Guid id) { var authorization = await _authorizationRepository.GetAsync(id); - return authorization.ToDto(JsonSerializer); + return authorization.ToDto(JsonSerializer)!; } public async virtual Task> GetListAsync(OpenIddictAuthorizationGetListInput input) diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationExtensions.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationExtensions.cs index 58c39cb02..cbbdf5c3c 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationExtensions.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Authorizations/OpenIddictAuthorizationExtensions.cs @@ -5,7 +5,7 @@ namespace LINGYUN.Abp.OpenIddict.Authorizations; internal static class OpenIddictAuthorizationExtensions { - public static OpenIddictAuthorizationDto ToDto(this OpenIddictAuthorization entity, IJsonSerializer jsonSerializer) + public static OpenIddictAuthorizationDto? ToDto(this OpenIddictAuthorization entity, IJsonSerializer jsonSerializer) { if (entity == null) { diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeAppService.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeAppService.cs index 4b0b511ab..0f3e480a3 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeAppService.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeAppService.cs @@ -45,9 +45,9 @@ public class OpenIddictScopeAppService : OpenIddictApplicationServiceBase, IOpen await _scopeManager.CreateAsync(scope.ToModel()); - scope = await _scoppeRepository.FindByIdAsync(scope.Id); + scope = await _scoppeRepository.GetAsync(scope.Id); - return scope.ToDto(JsonSerializer); + return scope.ToDto(JsonSerializer)!; } [Authorize(AbpOpenIddictPermissions.Scopes.Delete)] @@ -55,14 +55,14 @@ public class OpenIddictScopeAppService : OpenIddictApplicationServiceBase, IOpen { var scope = await _scopeManager.FindByIdAsync(_identifierConverter.ToString(id)); - await _scopeManager.DeleteAsync(scope); + await _scopeManager.DeleteAsync(scope!); } public async virtual Task GetAsync(Guid id) { var scope = await _scoppeRepository.GetAsync(id); - return scope.ToDto(JsonSerializer); + return scope.ToDto(JsonSerializer)!; } public async virtual Task> GetListAsync(OpenIddictScopeGetListInput input) @@ -71,7 +71,7 @@ public class OpenIddictScopeAppService : OpenIddictApplicationServiceBase, IOpen var entites = await _scoppeRepository.GetListAsync(input.Sorting, input.SkipCount, input.MaxResultCount, input.Filter); return new PagedResultDto(totalCount, - entites.Select(entity => entity.ToDto(JsonSerializer)).ToList()); + entites.Select(entity => entity.ToDto(JsonSerializer)!).ToList()); } [Authorize(AbpOpenIddictPermissions.Scopes.Update)] @@ -94,6 +94,6 @@ public class OpenIddictScopeAppService : OpenIddictApplicationServiceBase, IOpen scope = await _scoppeRepository.GetAsync(id); - return scope.ToDto(JsonSerializer); + return scope.ToDto(JsonSerializer)!; } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeExtensions.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeExtensions.cs index 1197eb1e1..c609540ea 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeExtensions.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Scopes/OpenIddictScopeExtensions.cs @@ -28,7 +28,7 @@ internal static class OpenIddictScopeExtensions return entity; } - public static OpenIddictScopeDto ToDto(this OpenIddictScope entity, IJsonSerializer jsonSerializer) + public static OpenIddictScopeDto? ToDto(this OpenIddictScope entity, IJsonSerializer jsonSerializer) { if (entity == null) { diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenAppService.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenAppService.cs index edd7337b9..37515a8ee 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenAppService.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenAppService.cs @@ -34,14 +34,14 @@ public class OpenIddictTokenAppService : OpenIddictApplicationServiceBase, IOpen { var token = await _tokenManager.FindByIdAsync(_identifierConverter.ToString(id)); - await _tokenManager.DeleteAsync(token); + await _tokenManager.DeleteAsync(token!); } public async virtual Task GetAsync(Guid id) { var token = await _tokenRepository.GetAsync(id); - return token.ToDto(); + return token.ToDto(JsonSerializer)!; } public async virtual Task> GetListAsync(OpenIddictTokenGetListInput input) @@ -88,7 +88,7 @@ public class OpenIddictTokenAppService : OpenIddictApplicationServiceBase, IOpen queryable = queryable.Where(x => x.Subject.Contains(input.Filter) || x.Status.Contains(input.Filter) || x.Type.Contains(input.Filter) || x.Payload.Contains(input.Filter) || x.Properties.Contains(input.Filter) || - x.ReferenceId.Contains(input.ReferenceId)); + x.ReferenceId.Contains(input.Filter)); } var totalCount = await AsyncExecuter.CountAsync(queryable); @@ -105,6 +105,6 @@ public class OpenIddictTokenAppService : OpenIddictApplicationServiceBase, IOpen var entites = await AsyncExecuter.ToListAsync(queryable); return new PagedResultDto(totalCount, - entites.Select(entity => entity.ToDto()).ToList()); + entites.Select(entity => entity.ToDto(JsonSerializer)!).ToList()); } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenExtensions.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenExtensions.cs index ed2aa2c58..0c2f74c67 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenExtensions.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN/Abp/OpenIddict/Tokens/OpenIddictTokenExtensions.cs @@ -1,11 +1,12 @@ using Volo.Abp; +using Volo.Abp.Json; using Volo.Abp.OpenIddict.Tokens; namespace LINGYUN.Abp.OpenIddict.Tokens; internal static class OpenIddictTokenExtensions { - public static OpenIddictToken ToEntity(this OpenIddictTokenDto dto, OpenIddictToken entity) + public static OpenIddictToken ToEntity(this OpenIddictTokenDto dto, OpenIddictToken entity, IJsonSerializer jsonSerializer) { Check.NotNull(dto, nameof(dto)); Check.NotNull(entity, nameof(entity)); @@ -15,7 +16,7 @@ internal static class OpenIddictTokenExtensions entity.CreationDate = dto.CreationDate; entity.ExpirationDate = dto.ExpirationDate; entity.Payload = dto.Payload; - entity.Properties = dto.Properties; + entity.Properties = jsonSerializer.Serialize(dto.Properties); entity.RedemptionDate = dto.RedemptionDate; entity.ReferenceId = dto.ReferenceId; entity.Status = dto.Status; @@ -31,7 +32,7 @@ internal static class OpenIddictTokenExtensions return entity; } - public static OpenIddictTokenDto ToDto(this OpenIddictToken entity) + public static OpenIddictTokenDto? ToDto(this OpenIddictToken entity, IJsonSerializer jsonSerializer) { if (entity == null) { @@ -46,12 +47,12 @@ internal static class OpenIddictTokenExtensions CreationDate = entity.CreationDate, ExpirationDate = entity.ExpirationDate, Payload = entity.Payload, - Properties = entity.Properties, RedemptionDate = entity.RedemptionDate, ReferenceId = entity.ReferenceId, Status = entity.Status, Subject = entity.Subject, - Type = entity.Type + Type = entity.Type, + Properties = jsonSerializer.DeserializeToDictionary(entity.Properties), }; foreach (var extraProperty in entity.ExtraProperties) diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/Volo/Abp/Json/IJsonSerializerExtensions.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/Volo/Abp/Json/IJsonSerializerExtensions.cs index fefabe370..2bc5b754f 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/Volo/Abp/Json/IJsonSerializerExtensions.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/Volo/Abp/Json/IJsonSerializerExtensions.cs @@ -14,7 +14,7 @@ internal static class IJsonSerializerExtensions return serializer.Deserialize>(source); } - public static Dictionary DeserializeToDictionary(this IJsonSerializer serializer, string source) + public static Dictionary DeserializeToDictionary(this IJsonSerializer serializer, string source) where TKey: notnull { if (source.IsNullOrWhiteSpace()) { diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ProcessSignInIdentitySession.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ProcessSignInIdentitySession.cs index bbb55f773..906510146 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ProcessSignInIdentitySession.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ProcessSignInIdentitySession.cs @@ -1,6 +1,7 @@ using LINGYUN.Abp.Identity.Session; using Microsoft.Extensions.Options; using OpenIddict.Server; +using System; using System.Threading.Tasks; namespace LINGYUN.Abp.OpenIddict.AspNetCore.Session; @@ -30,7 +31,8 @@ public class ProcessSignInIdentitySession : IOpenIddictServerHandler 401 diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ValidationTokenCheckIdentitySession.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ValidationTokenCheckIdentitySession.cs index dca10e982..9fbb9b612 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ValidationTokenCheckIdentitySession.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ValidationTokenCheckIdentitySession.cs @@ -29,10 +29,10 @@ public class ValidationTokenCheckIdentitySession : IOpenIddictValidationHandler< public async virtual ValueTask HandleAsync(OpenIddictValidationEvents.ValidateTokenContext context) { - var tenantId = context.Principal.FindTenantId(); + var tenantId = context.Principal?.FindTenantId(); using (CurrentTenant.Change(tenantId)) { - if (!await IdentitySessionChecker.ValidateSessionAsync(context.Principal)) + if (!await IdentitySessionChecker.ValidateSessionAsync(context.Principal!)) { context.Logger.LogWarning("The token is no longer valid because the user's session expired."); // Errors.InvalidToken ---> 401 diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/LINGYUN/Abp/OpenIddict/LinkUser/LinkUserTokenExtensionGrant.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/LINGYUN/Abp/OpenIddict/LinkUser/LinkUserTokenExtensionGrant.cs index e525e5d6a..f21641bf3 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/LINGYUN/Abp/OpenIddict/LinkUser/LinkUserTokenExtensionGrant.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/LINGYUN/Abp/OpenIddict/LinkUser/LinkUserTokenExtensionGrant.cs @@ -35,7 +35,7 @@ public class LinkUserTokenExtensionGrant : ITokenExtensionGrant var accessToken = accessTokenParam.ToString(); if (accessToken.IsNullOrWhiteSpace()) { - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = localizer["InvalidAccessToken"] @@ -61,7 +61,7 @@ public class LinkUserTokenExtensionGrant : ITokenExtensionGrant if (notification.IsRejected) { return Forbid( - new AuthenticationProperties(new Dictionary + new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = notification.Error ?? OpenIddictConstants.Errors.InvalidRequest, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = notification.ErrorDescription, @@ -74,7 +74,7 @@ public class LinkUserTokenExtensionGrant : ITokenExtensionGrant if (principal == null) { return Forbid( - new AuthenticationProperties(new Dictionary + new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = notification.Error ?? OpenIddictConstants.Errors.InvalidRequest, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = notification.ErrorDescription, @@ -93,7 +93,7 @@ public class LinkUserTokenExtensionGrant : ITokenExtensionGrant var linkUserIdParam = context.Request.GetParameter("LinkUserId"); if (!linkUserIdParam.HasValue || !Guid.TryParse(linkUserIdParam.Value.ToString(), out var linkUserId)) { - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = localizer["InvalidLinkUserId"] @@ -108,7 +108,7 @@ public class LinkUserTokenExtensionGrant : ITokenExtensionGrant { if (!Guid.TryParse(linkTenantIdParam.Value.ToString(), out var parsedGuid)) { - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = localizer["InvalidLinkTenantId"] @@ -124,7 +124,7 @@ public class LinkUserTokenExtensionGrant : ITokenExtensionGrant var linkUserManager = GetRequiredService(context); var isLinked = await linkUserManager.IsLinkedAsync( - new IdentityLinkUserInfo(userId.Value, currentTenant.Id), + new IdentityLinkUserInfo(userId!.Value, currentTenant.Id), new IdentityLinkUserInfo(linkUserId, linkTenantId)); if (isLinked) @@ -138,7 +138,7 @@ public class LinkUserTokenExtensionGrant : ITokenExtensionGrant } else { - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = localizer["TheTargetUserIsNotLinkedToYou"] @@ -149,7 +149,7 @@ public class LinkUserTokenExtensionGrant : ITokenExtensionGrant } } - protected virtual T GetRequiredService(ExtensionGrantContext context) + protected virtual T GetRequiredService(ExtensionGrantContext context) where T: notnull { return context.HttpContext.RequestServices.GetRequiredService(); } @@ -196,7 +196,7 @@ public class LinkUserTokenExtensionGrant : ITokenExtensionGrant await identitySecurityLogManager.SaveAsync(logContext); } - protected virtual Task FindClientIdAsync(ExtensionGrantContext context) + protected virtual Task FindClientIdAsync(ExtensionGrantContext context) { return Task.FromResult(context.Request.ClientId); } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN/Abp/OpenIddict/Portal/PortalTokenExtensionGrant.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN/Abp/OpenIddict/Portal/PortalTokenExtensionGrant.cs index bf231d4f9..c703bd9cd 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN/Abp/OpenIddict/Portal/PortalTokenExtensionGrant.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN/Abp/OpenIddict/Portal/PortalTokenExtensionGrant.cs @@ -32,7 +32,7 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant { public string Name => PortalTokenExtensionGrantConsts.GrantType; - protected IAbpLazyServiceProvider LazyServiceProvider { get; set; } + protected IAbpLazyServiceProvider LazyServiceProvider { get; set; } = default!; protected ICurrentTenant CurrentTenant => LazyServiceProvider.LazyGetRequiredService(); protected IEnterpriseRepository EnterpriseRepository => LazyServiceProvider.LazyGetRequiredService(); protected SignInManager SignInManager => LazyServiceProvider.LazyGetRequiredService>(); @@ -40,7 +40,7 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant protected IOpenIddictScopeManager ScopeManager => LazyServiceProvider.LazyGetRequiredService(); protected AbpOpenIddictClaimsPrincipalManager OpenIddictClaimsPrincipalManager => LazyServiceProvider.LazyGetRequiredService(); protected ILoggerFactory LoggerFactory => LazyServiceProvider.LazyGetRequiredService(); - protected ILogger Logger => LazyServiceProvider.LazyGetService(provider => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance); + protected ILogger Logger => LazyServiceProvider.LazyGetService(provider => LoggerFactory?.CreateLogger(GetType().FullName!) ?? NullLogger.Instance); protected IServiceScopeFactory ServiceScopeFactory => LazyServiceProvider.LazyGetRequiredService(); protected IOptions AbpIdentityOptions => LazyServiceProvider.LazyGetRequiredService>(); protected IOptions IdentityOptions => LazyServiceProvider.LazyGetRequiredService>(); @@ -63,12 +63,12 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant var enterprises = await EnterpriseRepository.GetEnterprisesInTenantListAsync(25); var properties = new AuthenticationProperties( - new Dictionary + new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "invalid_enterprise" }, - new Dictionary + new Dictionary { // 是否可直接选择的模式 { "Enterprises", JsonConvert.SerializeObject(enterprises.Select(x => new { Id = x.Id, Name = x.Name, Logo = x.Logo })) }, @@ -95,7 +95,7 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant using var scope = ServiceScopeFactory.CreateScope(); await ReplaceEmailToUsernameOfInputIfNeeds(context.Request); - IdentityUser user = null; + IdentityUser? user = null; if (AbpIdentityOptions.Value.ExternalLoginProviders.Any()) { @@ -106,7 +106,7 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant if (await externalLoginProvider.TryAuthenticateAsync(context.Request.Username, context.Request.Password)) { - user = await UserManager.FindByNameAsync(context.Request.Username); + user = await UserManager.FindByNameAsync(context.Request.Username!); if (user == null) { user = await externalLoginProvider.CreateUserAsync(context.Request.Username, externalLoginProviderInfo.Name); @@ -123,12 +123,12 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant await IdentityOptions.SetAsync(); - user = await UserManager.FindByNameAsync(context.Request.Username); + user = await UserManager.FindByNameAsync(context.Request.Username!); if (user == null) { Logger.LogInformation("No user found matching username: {username}", context.Request.Username); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "Invalid username or password!" @@ -145,7 +145,7 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); } - var result = await SignInManager.CheckPasswordSignInAsync(user, context.Request.Password, true); + var result = await SignInManager.CheckPasswordSignInAsync(user, context.Request.Password!, true); if (!result.Succeeded) { await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext @@ -184,7 +184,7 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant errorDescription = "Invalid username or password!"; } - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = errorDescription @@ -203,18 +203,18 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant protected virtual async Task ReplaceEmailToUsernameOfInputIfNeeds(OpenIddictRequest request) { - if (!ValidationHelper.IsValidEmailAddress(request.Username)) + if (!ValidationHelper.IsValidEmailAddress(request.Username!)) { return; } - var userByUsername = await UserManager.FindByNameAsync(request.Username); + var userByUsername = await UserManager.FindByNameAsync(request.Username!); if (userByUsername != null) { return; } - var userByEmail = await UserManager.FindByEmailAsync(request.Username); + var userByEmail = await UserManager.FindByEmailAsync(request.Username!); if (userByEmail == null) { return; @@ -237,7 +237,7 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant Logger.LogInformation("Authentication failed for username: {username}, reason: InvalidAuthenticatorCode", context.Request.Username); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "Invalid authenticator code!" @@ -259,13 +259,13 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant }); var properties = new AuthenticationProperties( - items: new Dictionary + items: new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = nameof(SignInResult.RequiresTwoFactor), }, - parameters: new Dictionary + parameters: new Dictionary { ["userId"] = user.Id.ToString("N"), ["twoFactorToken"] = twoFactorToken @@ -275,17 +275,17 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant } } - protected virtual async Task HandleShouldChangePasswordOnNextLoginAsync(ExtensionGrantContext context, IdentityUser user, string currentPassword) + protected virtual async Task HandleShouldChangePasswordOnNextLoginAsync(ExtensionGrantContext context, IdentityUser user, string? currentPassword) { return await HandleChangePasswordAsync(context, user, currentPassword, ChangePasswordType.ShouldChangePasswordOnNextLogin); } - protected virtual async Task HandlePeriodicallyChangePasswordAsync(ExtensionGrantContext context, IdentityUser user, string currentPassword) + protected virtual async Task HandlePeriodicallyChangePasswordAsync(ExtensionGrantContext context, IdentityUser user, string? currentPassword) { return await HandleChangePasswordAsync(context, user, currentPassword, ChangePasswordType.PeriodicallyChangePassword); } - protected virtual async Task HandleChangePasswordAsync(ExtensionGrantContext context, IdentityUser user, string currentPassword, ChangePasswordType changePasswordType) + protected virtual async Task HandleChangePasswordAsync(ExtensionGrantContext context, IdentityUser user, string? currentPassword, ChangePasswordType changePasswordType) { var changePasswordToken = context.Request.GetParameter("ChangePasswordToken")?.ToString(); var newPassword = context.Request.GetParameter("NewPassword")?.ToString(); @@ -316,7 +316,7 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant { Logger.LogInformation("ChangePassword failed for username: {username}, reason: {changePasswordResult}", context.Request.Username, changePasswordResult.Errors.Select(x => x.Description).JoinAsString(", ")); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = changePasswordResult.Errors.Select(x => x.Description).JoinAsString(", ") @@ -328,7 +328,7 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant { Logger.LogInformation("Authentication failed for username: {username}, reason: InvalidAuthenticatorCode", context.Request.Username); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "Invalid authenticator code!" @@ -350,12 +350,12 @@ public class PortalTokenExtensionGrant : ITokenExtensionGrant }); var properties = new AuthenticationProperties( - items: new Dictionary + items: new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = changePasswordType.ToString() }, - parameters: new Dictionary + parameters: new Dictionary { ["userId"] = user.Id.ToString("N"), ["changePasswordToken"] = await UserManager.GenerateUserTokenAsync(user, TokenOptions.DefaultProvider, changePasswordType.ToString()) diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.QrCode/LINGYUN/Abp/OpenIddict/QrCode/QrCodeTokenExtensionGrant.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.QrCode/LINGYUN/Abp/OpenIddict/QrCode/QrCodeTokenExtensionGrant.cs index c1c94d576..37b06c2ac 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.QrCode/LINGYUN/Abp/OpenIddict/QrCode/QrCodeTokenExtensionGrant.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.QrCode/LINGYUN/Abp/OpenIddict/QrCode/QrCodeTokenExtensionGrant.cs @@ -35,7 +35,7 @@ public class QrCodeTokenExtensionGrant : ITokenExtensionGrant logger.LogInformation("The user has not passed the QR code Key required for scanning and login."); var properties = new AuthenticationProperties( - new Dictionary + new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The Qr code is invalid." @@ -52,7 +52,7 @@ public class QrCodeTokenExtensionGrant : ITokenExtensionGrant logger.LogInformation("The QR code Key {0} is invalid or the user has not scanned the QR code.", qrcodeKey); var properties = new AuthenticationProperties( - new Dictionary + new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The Qr code is invalid." @@ -73,11 +73,11 @@ public class QrCodeTokenExtensionGrant : ITokenExtensionGrant using (currentTenant.Change(tenantId)) { - var user = await userManager.FindByIdAsync(qrCodeInfo.UserId); + var user = await userManager.FindByIdAsync(qrCodeInfo.UserId!); if (user == null) { var properties = new AuthenticationProperties( - new Dictionary + new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "Invalid user id." @@ -90,7 +90,7 @@ public class QrCodeTokenExtensionGrant : ITokenExtensionGrant { logger.LogInformation("Authentication failed for username: {username}, reason: the user token is invalid", user.UserName); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = OpenIddictResources.GetResourceString(OpenIddictResources.ID2019), @@ -106,7 +106,7 @@ public class QrCodeTokenExtensionGrant : ITokenExtensionGrant { logger.LogInformation("Authentication failed for username: {username}, reason: locked out", user.UserName); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The user account has been locked out due to invalid login attempts. Please wait a while and try again.", @@ -123,12 +123,12 @@ public class QrCodeTokenExtensionGrant : ITokenExtensionGrant } } - protected virtual T GetRequiredService(ExtensionGrantContext context) + protected virtual T GetRequiredService(ExtensionGrantContext context) where T: notnull { return context.HttpContext.RequestServices.GetRequiredService(); } - protected virtual Task FindClientIdAsync(ExtensionGrantContext context) + protected virtual Task FindClientIdAsync(ExtensionGrantContext context) { return Task.FromResult(context.Request.ClientId); } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/LINGYUN/Abp/OpenIddict/Sms/SmsTokenExtensionGrant.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/LINGYUN/Abp/OpenIddict/Sms/SmsTokenExtensionGrant.cs index b21a7a1a3..b9d6e0d88 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/LINGYUN/Abp/OpenIddict/Sms/SmsTokenExtensionGrant.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/LINGYUN/Abp/OpenIddict/Sms/SmsTokenExtensionGrant.cs @@ -38,7 +38,7 @@ public class SmsTokenExtensionGrant : ITokenExtensionGrant { logger.LogInformation("Invalid grant type: phone number or token code not found"); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = localizer["InvalidGrant:PhoneOrTokenCodeNotFound"] @@ -54,12 +54,12 @@ public class SmsTokenExtensionGrant : ITokenExtensionGrant var userRepo = GetRequiredService(context); - var currentUser = await userRepo.FindByPhoneNumberAsync(phoneNumber); + var currentUser = await userRepo.FindByPhoneNumberAsync(phoneNumber!); if (currentUser == null) { logger.LogInformation("Invalid grant type: phone number not register"); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = localizer["InvalidGrant:PhoneNumberNotRegister"] @@ -75,7 +75,7 @@ public class SmsTokenExtensionGrant : ITokenExtensionGrant var identityLocalizer = GetRequiredService>(context); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = identityLocalizer["Volo.Abp.Identity:UserLockedOut"] @@ -107,7 +107,7 @@ public class SmsTokenExtensionGrant : ITokenExtensionGrant await SaveSecurityLogAsync(context, currentUser, SmsTokenExtensionGrantConsts.SecurityCodeFailed); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = errorDescription @@ -119,7 +119,7 @@ public class SmsTokenExtensionGrant : ITokenExtensionGrant return await SetSuccessResultAsync(context, currentUser, logger); } - protected virtual T GetRequiredService(ExtensionGrantContext context) + protected virtual T GetRequiredService(ExtensionGrantContext context) where T: notnull { return context.HttpContext.RequestServices.GetRequiredService(); } @@ -167,7 +167,7 @@ public class SmsTokenExtensionGrant : ITokenExtensionGrant await identitySecurityLogManager.SaveAsync(logContext); } - protected virtual Task FindClientIdAsync(ExtensionGrantContext context) + protected virtual Task FindClientIdAsync(ExtensionGrantContext context) { return Task.FromResult(context.Request.ClientId); } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/LINGYUN/Abp/OpenIddict/WeChat/Work/WeChatWorkTokenExtensionGrant.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/LINGYUN/Abp/OpenIddict/WeChat/Work/WeChatWorkTokenExtensionGrant.cs index d68931405..4c9b1e49e 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/LINGYUN/Abp/OpenIddict/WeChat/Work/WeChatWorkTokenExtensionGrant.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/LINGYUN/Abp/OpenIddict/WeChat/Work/WeChatWorkTokenExtensionGrant.cs @@ -49,7 +49,7 @@ public class WeChatWorkTokenExtensionGrant : ITokenExtensionGrant { logger.LogWarning("Invalid grant type: code not found"); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = localizer["InvalidGrant:AgentIdOrCodeNotFound"] @@ -78,7 +78,7 @@ public class WeChatWorkTokenExtensionGrant : ITokenExtensionGrant { logger.LogWarning("Invalid grant type: wechat work user {userId} not register", userInfo.UserId); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = localizer["InvalidGrant:UserIdNotRegister"] @@ -107,7 +107,7 @@ public class WeChatWorkTokenExtensionGrant : ITokenExtensionGrant logger.LogInformation("Authentication failed for username: {username}, reason: locked out", currentUser.UserName); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = identityLocalizer["Volo.Abp.Identity:UserLockedOut"] @@ -122,7 +122,7 @@ public class WeChatWorkTokenExtensionGrant : ITokenExtensionGrant } catch (AbpWeChatWorkException wwe) { - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = wwe.Code @@ -137,7 +137,7 @@ public class WeChatWorkTokenExtensionGrant : ITokenExtensionGrant return Task.CompletedTask; } - protected virtual T GetRequiredService(ExtensionGrantContext context) + protected virtual T GetRequiredService(ExtensionGrantContext context) where T: notnull { return context.HttpContext.RequestServices.GetRequiredService(); } @@ -190,7 +190,7 @@ public class WeChatWorkTokenExtensionGrant : ITokenExtensionGrant await identitySecurityLogManager.SaveAsync(logContext); } - protected virtual Task FindClientIdAsync(ExtensionGrantContext context) + protected virtual Task FindClientIdAsync(ExtensionGrantContext context) { return Task.FromResult(context.Request.ClientId); } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatMiniProgramTokenExtensionGrant.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatMiniProgramTokenExtensionGrant.cs index 40d391cb3..36293781f 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatMiniProgramTokenExtensionGrant.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatMiniProgramTokenExtensionGrant.cs @@ -29,7 +29,7 @@ public class WeChatMiniProgramTokenExtensionGrant : WeChatTokenExtensionGrant } } - protected async override Task FindOpenIdAsync(ExtensionGrantContext context, string code) + protected async override Task FindOpenIdAsync(ExtensionGrantContext context, string code) { var weChatOpenIdFinder = GetRequiredService(context); var optionsFactory = GetRequiredService(context); diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatOffcialTokenExtensionGrant.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatOffcialTokenExtensionGrant.cs index 2a9290767..299f764cc 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatOffcialTokenExtensionGrant.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatOffcialTokenExtensionGrant.cs @@ -24,7 +24,7 @@ public class WeChatOffcialTokenExtensionGrant : WeChatTokenExtensionGrant // } //} - protected async override Task FindOpenIdAsync(ExtensionGrantContext context, string code) + protected async override Task FindOpenIdAsync(ExtensionGrantContext context, string code) { var weChatOpenIdFinder = GetRequiredService(context); var optionsFactory = GetRequiredService(context); diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatTokenExtensionGrant.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatTokenExtensionGrant.cs index 9692057d0..c99129093 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatTokenExtensionGrant.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN/Abp/OpenIddict/WeChat/WeChatTokenExtensionGrant.cs @@ -35,7 +35,7 @@ public abstract class WeChatTokenExtensionGrant : ITokenExtensionGrant public abstract string LoginProvider { get; } public abstract string AuthenticationMethod { get; } - protected abstract Task FindOpenIdAsync(ExtensionGrantContext context, string code); + protected abstract Task FindOpenIdAsync(ExtensionGrantContext context, string code); public async virtual Task HandleAsync(ExtensionGrantContext context) { @@ -55,7 +55,7 @@ public abstract class WeChatTokenExtensionGrant : ITokenExtensionGrant { logger.LogWarning("Invalid grant type: wechat code not found"); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = localizer["InvalidGrant:WeChatCodeNotFound"] @@ -64,14 +64,14 @@ public abstract class WeChatTokenExtensionGrant : ITokenExtensionGrant return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); } - WeChatOpenId wechatOpenId; + WeChatOpenId? wechatOpenId; try { wechatOpenId = await FindOpenIdAsync(context, wechatCode); } catch (AbpWeChatException e) { - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = e.Message @@ -79,6 +79,18 @@ public abstract class WeChatTokenExtensionGrant : ITokenExtensionGrant return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); } + if (wechatOpenId == null) + { + logger.LogWarning("Invalid grant type: WeChat authentication failed. Unable to obtain WeChat user information through the code: {}.", wechatCode); + + var properties = new AuthenticationProperties(new Dictionary + { + [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, + [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = localizer["InvalidGrant:WeChatTokenInvalid"] + }); + + return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); + } var userManager = GetRequiredService(context); var currentUser = await userManager.FindByLoginAsync(LoginProvider, wechatOpenId.OpenId); @@ -93,7 +105,7 @@ public abstract class WeChatTokenExtensionGrant : ITokenExtensionGrant { logger.LogWarning("Invalid grant type: wechat openid {openid} not register", wechatOpenId.OpenId); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = localizer["InvalidGrant:WeChatNotRegister"] @@ -122,7 +134,7 @@ public abstract class WeChatTokenExtensionGrant : ITokenExtensionGrant logger.LogInformation("Authentication failed for username: {username}, reason: locked out", currentUser.UserName); - var properties = new AuthenticationProperties(new Dictionary + var properties = new AuthenticationProperties(new Dictionary { [OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = identityLocalizer["Volo.Abp.Identity:UserLockedOut"] @@ -141,7 +153,7 @@ public abstract class WeChatTokenExtensionGrant : ITokenExtensionGrant return Task.CompletedTask; } - protected virtual T GetRequiredService(ExtensionGrantContext context) + protected virtual T GetRequiredService(ExtensionGrantContext context) where T: notnull { return context.HttpContext.RequestServices.GetRequiredService(); } @@ -204,7 +216,7 @@ public abstract class WeChatTokenExtensionGrant : ITokenExtensionGrant await identitySecurityLogManager.SaveAsync(logContext); } - protected virtual Task FindClientIdAsync(ExtensionGrantContext context) + protected virtual Task FindClientIdAsync(ExtensionGrantContext context) { return Task.FromResult(context.Request.ClientId); } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionCreateDto.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionCreateDto.cs index c581bce2b..3ffa69a12 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionCreateDto.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionCreateDto.cs @@ -8,9 +8,9 @@ public class PermissionDefinitionCreateDto : PermissionDefinitionCreateOrUpdateD { [Required] [DynamicStringLength(typeof(PermissionDefinitionRecordConsts), nameof(PermissionDefinitionRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] [DynamicStringLength(typeof(PermissionGroupDefinitionRecordConsts), nameof(PermissionGroupDefinitionRecordConsts.MaxNameLength))] - public string GroupName { get; set; } + public string GroupName { get; set; } = default!; } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionCreateOrUpdateDto.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionCreateOrUpdateDto.cs index db53de6ff..7f74512f0 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionCreateOrUpdateDto.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionCreateOrUpdateDto.cs @@ -11,16 +11,16 @@ public abstract class PermissionDefinitionCreateOrUpdateDto : IHasExtraPropertie { [Required] [DynamicStringLength(typeof(PermissionDefinitionRecordConsts), nameof(PermissionDefinitionRecordConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(PermissionDefinitionRecordConsts), nameof(PermissionDefinitionRecordConsts.MaxNameLength))] - public string ParentName { get; set; } + public string? ParentName { get; set; } [DynamicStringLength(typeof(PermissionDefinitionRecordConsts), nameof(PermissionDefinitionRecordConsts.MaxResourceNameLength))] - public string ResourceName { get; set; } + public string? ResourceName { get; set; } [DynamicStringLength(typeof(PermissionDefinitionRecordConsts), nameof(PermissionDefinitionRecordConsts.MaxManagementPermissionNameLength))] - public string ManagementPermissionName { get; set; } + public string? ManagementPermissionName { get; set; } public bool IsEnabled { get; set; } @@ -29,7 +29,7 @@ public abstract class PermissionDefinitionCreateOrUpdateDto : IHasExtraPropertie public List Providers { get; set; } = new List(); [DynamicStringLength(typeof(PermissionDefinitionRecordConsts), nameof(PermissionDefinitionRecordConsts.MaxStateCheckersLength))] - public string StateCheckers { get; set; } + public string? StateCheckers { get; set; } public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary(); } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionDto.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionDto.cs index 155e0245c..7db245709 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionDto.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionDto.cs @@ -6,17 +6,17 @@ namespace LINGYUN.Abp.PermissionManagement.Definitions; public class PermissionDefinitionDto : IHasExtraProperties { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string ParentName { get; set; } + public string? ParentName { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; - public string GroupName { get; set; } + public string? GroupName { get; set; } - public string ResourceName { get; set; } + public string? ResourceName { get; set; } - public string ManagementPermissionName { get; set; } + public string? ManagementPermissionName { get; set; } public bool IsEnabled { get; set; } @@ -26,7 +26,7 @@ public class PermissionDefinitionDto : IHasExtraProperties public List Providers { get; set; } = new List(); - public string StateCheckers { get; set; } + public string? StateCheckers { get; set; } public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary(); } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionGetListInput.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionGetListInput.cs index eac26bba1..68b047107 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionGetListInput.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionGetListInput.cs @@ -1,7 +1,7 @@ namespace LINGYUN.Abp.PermissionManagement.Definitions; public class PermissionDefinitionGetListInput { - public string Filter { get; set; } + public string? Filter { get; set; } - public string GroupName { get; set; } + public string? GroupName { get; set; } } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionUpdateDto.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionUpdateDto.cs index 07d4044cf..8bd0f290e 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionUpdateDto.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionDefinitionUpdateDto.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.PermissionManagement.Definitions; public class PermissionDefinitionUpdateDto : PermissionDefinitionCreateOrUpdateDto, IHasConcurrencyStamp { [StringLength(40)] - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionCreateDto.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionCreateDto.cs index 4d93939d3..08e14ed60 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionCreateDto.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionCreateDto.cs @@ -7,5 +7,5 @@ public class PermissionGroupDefinitionCreateDto : PermissionGroupDefinitionCreat { [Required] [DynamicStringLength(typeof(PermissionGroupDefinitionRecordConsts), nameof(PermissionGroupDefinitionRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionCreateOrUpdateDto.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionCreateOrUpdateDto.cs index b9c3eb78c..3cf99b237 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionCreateOrUpdateDto.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionCreateOrUpdateDto.cs @@ -9,7 +9,7 @@ public abstract class PermissionGroupDefinitionCreateOrUpdateDto : IHasExtraProp { [Required] [DynamicStringLength(typeof(PermissionGroupDefinitionRecordConsts), nameof(PermissionGroupDefinitionRecordConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary(); } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionDto.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionDto.cs index 96f6ab58d..eec74983c 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionDto.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionDto.cs @@ -4,9 +4,9 @@ namespace LINGYUN.Abp.PermissionManagement.Definitions; public class PermissionGroupDefinitionDto : IHasExtraProperties { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public bool IsStatic { get; set; } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionGetListInput.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionGetListInput.cs index 4b0aa10de..959a00b0c 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionGetListInput.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionGetListInput.cs @@ -1,5 +1,5 @@ namespace LINGYUN.Abp.PermissionManagement.Definitions; public class PermissionGroupDefinitionGetListInput { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionUpdateDto.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionUpdateDto.cs index 370fe95e5..345a39b93 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionUpdateDto.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN/Abp/PermissionManagement/Definitions/Dto/PermissionGroupDefinitionUpdateDto.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.PermissionManagement.Definitions; public class PermissionGroupDefinitionUpdateDto : PermissionGroupDefinitionCreateOrUpdateDto, IHasConcurrencyStamp { [StringLength(40)] - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionDefinitionAppService.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionDefinitionAppService.cs index ac0291ad6..43539aec2 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionDefinitionAppService.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionDefinitionAppService.cs @@ -89,7 +89,7 @@ public class PermissionDefinitionAppService : PermissionManagementAppServiceBase definitionRecord = await _definitionRepository.InsertAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(definitionRecord); } @@ -105,7 +105,7 @@ public class PermissionDefinitionAppService : PermissionManagementAppServiceBase await _definitionRepository.DeleteAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(string name) @@ -144,7 +144,7 @@ public class PermissionDefinitionAppService : PermissionManagementAppServiceBase definitionRecord = await _definitionBasicRepository.UpdateAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(definitionRecord); } @@ -178,7 +178,7 @@ public class PermissionDefinitionAppService : PermissionManagementAppServiceBase { record.ManagementPermissionName = input.ManagementPermissionName; } - string providers = null; + string? providers = null; if (!input.Providers.IsNullOrEmpty()) { providers = input.Providers.JoinAsString(","); @@ -200,7 +200,10 @@ public class PermissionDefinitionAppService : PermissionManagementAppServiceBase { // 校验格式 var permissionDefinition = await _staticPermissionDefinitionStore.GetOrNullAsync(PermissionManagementPermissionNames.Definition.Default); - var _ = _simpleStateCheckerSerializer.DeserializeArray(input.StateCheckers, permissionDefinition); + if (permissionDefinition != null && !input.StateCheckers.IsNullOrWhiteSpace()) + { + var _ = _simpleStateCheckerSerializer.DeserializeArray(input.StateCheckers, permissionDefinition); + } record.StateCheckers = input.StateCheckers; } @@ -217,7 +220,7 @@ public class PermissionDefinitionAppService : PermissionManagementAppServiceBase } } - protected async virtual Task FindByNameAsync(string name) + protected async virtual Task FindByNameAsync(string name) { var DefinitionFilter = await _definitionBasicRepository.GetQueryableAsync(); diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionGroupDefinitionAppService.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionGroupDefinitionAppService.cs index bee784c11..ab5bf9006 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionGroupDefinitionAppService.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionGroupDefinitionAppService.cs @@ -51,7 +51,7 @@ public class PermissionGroupDefinitionAppService : PermissionManagementAppServic groupDefinitionRecord = await _groupDefinitionRepository.InsertAsync(groupDefinitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(groupDefinitionRecord); } @@ -67,7 +67,7 @@ public class PermissionGroupDefinitionAppService : PermissionManagementAppServic await _groupDefinitionRepository.DeleteAsync(groupDefinitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(string name) @@ -107,12 +107,12 @@ public class PermissionGroupDefinitionAppService : PermissionManagementAppServic groupDefinitionRecord = await _groupDefinitionBasicRepository.UpdateAsync(groupDefinitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(groupDefinitionRecord); } - protected async virtual Task FindByNameAsync(string name) + protected async virtual Task FindByNameAsync(string name) { var groupDefinitionFilter = await _groupDefinitionBasicRepository.GetQueryableAsync(); diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/Volo/Abp/Authorization/Permissions/IPermissionDefinitionManagerExtensions.cs b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/Volo/Abp/Authorization/Permissions/IPermissionDefinitionManagerExtensions.cs index 132b6e6ea..e66b43db8 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/Volo/Abp/Authorization/Permissions/IPermissionDefinitionManagerExtensions.cs +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/Volo/Abp/Authorization/Permissions/IPermissionDefinitionManagerExtensions.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; namespace Volo.Abp.Authorization.Permissions; public static class IPermissionDefinitionManagerExtensions { - public async static Task GetGroupOrNullAsync( + public async static Task GetGroupOrNullAsync( this IPermissionDefinitionManager permissionDefinitionManager, string name ) diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.Emailing.Platform/LINGYUN/Abp/Emailing/Platform/PlatformEmailSender.cs b/aspnet-core/modules/platform/LINGYUN.Abp.Emailing.Platform/LINGYUN/Abp/Emailing/Platform/PlatformEmailSender.cs index fb058b1be..f750d665b 100644 --- a/aspnet-core/modules/platform/LINGYUN.Abp.Emailing.Platform/LINGYUN/Abp/Emailing/Platform/PlatformEmailSender.cs +++ b/aspnet-core/modules/platform/LINGYUN.Abp.Emailing.Platform/LINGYUN/Abp/Emailing/Platform/PlatformEmailSender.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Net.Mail; using System.Threading.Tasks; using Volo.Abp.Content; @@ -22,22 +23,22 @@ public class PlatformEmailSender : IEmailSender _service = service; } - public virtual Task QueueAsync(string to, string subject, string body, bool isBodyHtml = true, AdditionalEmailSendingArgs additionalEmailSendingArgs = null) + public virtual Task QueueAsync(string to, string subject, string body, bool isBodyHtml = true, AdditionalEmailSendingArgs? additionalEmailSendingArgs = null) { return SendAsync(from: null, to, subject, body, isBodyHtml, additionalEmailSendingArgs); } - public virtual Task QueueAsync(string from, string to, string subject, string body, bool isBodyHtml = true, AdditionalEmailSendingArgs additionalEmailSendingArgs = null) + public virtual Task QueueAsync(string from, string to, string subject, string body, bool isBodyHtml = true, AdditionalEmailSendingArgs? additionalEmailSendingArgs = null) { return SendAsync(from, to, subject, body, isBodyHtml, additionalEmailSendingArgs); } - public virtual Task SendAsync(string to, string subject, string body, bool isBodyHtml = true, AdditionalEmailSendingArgs additionalEmailSendingArgs = null) + public virtual Task SendAsync(string to, string? subject, string? body, bool isBodyHtml = true, AdditionalEmailSendingArgs? additionalEmailSendingArgs = null) { return SendAsync(from: null, to, subject, body, isBodyHtml, additionalEmailSendingArgs); } - public async virtual Task SendAsync(string from, string to, string subject, string body, bool isBodyHtml = true, AdditionalEmailSendingArgs additionalEmailSendingArgs = null) + public async virtual Task SendAsync(string? from, string to, string? subject, string? body, bool isBodyHtml = true, AdditionalEmailSendingArgs? additionalEmailSendingArgs = null) { var createInput = new EmailMessageCreateDto( to, @@ -56,13 +57,16 @@ public class PlatformEmailSender : IEmailSender foreach (var attachment in additionalEmailSendingArgs.Attachments) { - var stream = new MemoryStream(attachment.File.Length); + if (attachment.File != null) + { + var stream = new MemoryStream(attachment.File.Length); - await stream.WriteAsync(attachment.File, 0, attachment.File.Length); + await stream.WriteAsync(attachment.File, 0, attachment.File.Length); - stream.Seek(0, SeekOrigin.Begin); + stream.Seek(0, SeekOrigin.Begin); - attachments.Add(new RemoteStreamContent(stream, attachment.Name)); + attachments.Add(new RemoteStreamContent(stream, attachment.Name)); + } } createInput.Attachments = attachments.ToArray(); @@ -119,7 +123,7 @@ public class PlatformEmailSender : IEmailSender var value = mail.Headers.Get(key); if (!value.IsNullOrWhiteSpace()) { - headers.Add(new EmailMessageHeaderDto(key, value)); + headers.Add(new EmailMessageHeaderDto(key!, value)); } } createInput.Headers = headers; diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminNavigationSeedContributor.cs b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminNavigationSeedContributor.cs index 366a020f1..a4d259399 100644 --- a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminNavigationSeedContributor.cs +++ b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminNavigationSeedContributor.cs @@ -53,7 +53,7 @@ public class VueVbenAdminNavigationSeedContributor : NavigationSeedContributor var layout = await SeedDefaultLayoutAsync(layoutData, uiDataItem); - var latMenu = await MenuRepository.GetLastMenuAsync(); + var latMenu = await MenuRepository.FindLastMenuAsync(); if (int.TryParse(CodeNumberGenerator.GetLastCode(latMenu?.Code ?? "0"), out int _lastNumber)) { @@ -76,7 +76,7 @@ public class VueVbenAdminNavigationSeedContributor : NavigationSeedContributor continue; } - var menuMeta = new Dictionary(menu.ExtraProperties) + var menuMeta = new Dictionary(menu.ExtraProperties) { { "title", menu.DisplayName }, { "icon", menu.Icon ?? "" }, @@ -91,7 +91,7 @@ public class VueVbenAdminNavigationSeedContributor : NavigationSeedContributor name: menu.Name, path: menu.Url, code: CodeNumberGenerator.CreateCode(GetNextCode()), - component: layout.Path, + component: layout.Path!, displayName: menu.DisplayName, redirect: menu.Redirect, description: menu.Description, @@ -118,7 +118,7 @@ public class VueVbenAdminNavigationSeedContributor : NavigationSeedContributor { continue; } - var menuMeta = new Dictionary(item.ExtraProperties) + var menuMeta = new Dictionary(item.ExtraProperties) { { "title", item.DisplayName }, { "icon", item.Icon ?? "" }, @@ -133,7 +133,7 @@ public class VueVbenAdminNavigationSeedContributor : NavigationSeedContributor name: item.Name, path: item.Url, code: CodeNumberGenerator.AppendCode(menu.Code, CodeNumberGenerator.CreateCode(index)), - component: item.Component.IsNullOrWhiteSpace() ? layout.Path : item.Component, + component: item.Component.IsNullOrWhiteSpace() ? layout.Path! : item.Component, displayName: item.DisplayName, redirect: item.Redirect, description: item.Description, @@ -156,17 +156,17 @@ public class VueVbenAdminNavigationSeedContributor : NavigationSeedContributor string code, string component, string displayName, - string redirect = "", - string description = "", + string? redirect = null, + string? description = null, Guid? parentId = null, Guid? tenantId = null, - Dictionary meta = null, - string[] roles = null, - Guid[] users = null, + Dictionary? meta = null, + string[]? roles = null, + Guid[]? users = null, bool isPublic = false ) { - var menuMeta = new Dictionary(); + var menuMeta = new Dictionary(); foreach (var item in data.Items) { menuMeta[item.Name] = item.DefaultValue; @@ -236,7 +236,7 @@ public class VueVbenAdminNavigationSeedContributor : NavigationSeedContributor await DataDictionaryDataSeeder.SeedAsync(data); - return data.FindItem(Options.UI); + return data.FindItem(Options.UI)!; } private async Task SeedDefaultLayoutAsync(Data data, DataItem uiDataItem) diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminStandardMenuConverter.cs b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminStandardMenuConverter.cs index 3f922bceb..bca779d45 100644 --- a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminStandardMenuConverter.cs +++ b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminStandardMenuConverter.cs @@ -12,7 +12,7 @@ public class VueVbenAdminStandardMenuConverter : IStandardMenuConverter, ISingle { Icon = "", Name = menu.Name, - Path = menu.Path, + Path = menu.Path!, DisplayName = menu.DisplayName, Description = menu.Description, Redirect = menu.Redirect, @@ -20,7 +20,7 @@ public class VueVbenAdminStandardMenuConverter : IStandardMenuConverter, ISingle if (menu.ExtraProperties.TryGetValue("icon", out var icon)) { - standardMenu.Icon = icon.ToString(); + standardMenu.Icon = icon?.ToString(); } return standardMenu; diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/VueVbenAdmin5NavigationSeedContributor.cs b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/VueVbenAdmin5NavigationSeedContributor.cs index 79f2be9d9..e0d3bd1eb 100644 --- a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/VueVbenAdmin5NavigationSeedContributor.cs +++ b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/VueVbenAdmin5NavigationSeedContributor.cs @@ -53,7 +53,7 @@ public class VueVbenAdmin5NavigationSeedContributor : NavigationSeedContributor var layout = await SeedDefaultLayoutAsync(layoutData, uiDataItem); - var latMenu = await MenuRepository.GetLastMenuAsync(); + var latMenu = await MenuRepository.FindLastMenuAsync(); if (int.TryParse(CodeNumberGenerator.GetLastCode(latMenu?.Code ?? "0"), out int _lastNumber)) { @@ -76,7 +76,7 @@ public class VueVbenAdmin5NavigationSeedContributor : NavigationSeedContributor continue; } - var menuMeta = new Dictionary(menu.ExtraProperties) + var menuMeta = new Dictionary(menu.ExtraProperties) { ["icon"] = menu.Icon ?? "", ["order"] = menu.Order @@ -88,7 +88,7 @@ public class VueVbenAdmin5NavigationSeedContributor : NavigationSeedContributor name: menu.Name, path: menu.Url, code: CodeNumberGenerator.CreateCode(GetNextCode()), - component: layout.Path, + component: layout.Path!, displayName: menu.DisplayName, redirect: menu.Redirect, description: menu.Description, @@ -116,7 +116,7 @@ public class VueVbenAdmin5NavigationSeedContributor : NavigationSeedContributor continue; } - var menuMeta = new Dictionary(item.ExtraProperties) + var menuMeta = new Dictionary(item.ExtraProperties) { ["icon"] = item.Icon ?? "", ["order"] = item.Order @@ -128,7 +128,7 @@ public class VueVbenAdmin5NavigationSeedContributor : NavigationSeedContributor name: item.Name, path: item.Url, code: CodeNumberGenerator.AppendCode(menu.Code, CodeNumberGenerator.CreateCode(index)), - component: item.Component.IsNullOrWhiteSpace() ? layout.Path : item.Component, + component: item.Component.IsNullOrWhiteSpace() ? layout.Path! : item.Component, displayName: item.DisplayName, redirect: item.Redirect, description: item.Description, @@ -151,17 +151,17 @@ public class VueVbenAdmin5NavigationSeedContributor : NavigationSeedContributor string code, string component, string displayName, - string redirect = "", - string description = "", + string? redirect = null, + string? description = null, Guid? parentId = null, Guid? tenantId = null, - Dictionary meta = null, - string[] roles = null, - Guid[] users = null, + Dictionary? meta = null, + string[]? roles = null, + Guid[]? users = null, bool isPublic = false ) { - var menuMeta = new Dictionary(); + var menuMeta = new Dictionary(); foreach (var item in data.Items) { menuMeta[item.Name] = item.DefaultValue; @@ -231,7 +231,7 @@ public class VueVbenAdmin5NavigationSeedContributor : NavigationSeedContributor await DataDictionaryDataSeeder.SeedAsync(data); - return data.FindItem(Options.UI); + return data.FindItem(Options.UI)!; } private async Task SeedDefaultLayoutAsync(Data data, DataItem uiDataItem) diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/VueVbenAdmin5StandardMenuConverter.cs b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/VueVbenAdmin5StandardMenuConverter.cs index 63f510391..e7081f3f3 100644 --- a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/VueVbenAdmin5StandardMenuConverter.cs +++ b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/VueVbenAdmin5StandardMenuConverter.cs @@ -12,7 +12,7 @@ public class VueVbenAdmin5StandardMenuConverter : IStandardMenuConverter, ISingl { Icon = "", Name = menu.Name, - Path = menu.Path, + Path = menu.Path!, DisplayName = menu.DisplayName, Description = menu.Description, Redirect = menu.Redirect, diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateOrUpdateDto.cs index c514ab788..49a5c6ade 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateOrUpdateDto.cs @@ -7,12 +7,12 @@ public class DataCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataDto.cs index e851e1652..cf877914b 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataDto.cs @@ -6,13 +6,13 @@ namespace LINGYUN.Platform.Datas; public class DataDto : EntityDto { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string Code { get; set; } + public string Code { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; - public string Description { get; set; } + public string? Description { get; set; } public Guid? ParentId { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateDto.cs index 7d285a2ed..897b5bae2 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateDto.cs @@ -8,5 +8,5 @@ public class DataItemCreateDto : DataItemCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateOrUpdateDto.cs index 8d1acff0d..650b32187 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateOrUpdateDto.cs @@ -12,13 +12,13 @@ public class DataItemCreateOrUpdateDto : IValidatableObject { [Required] [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxValueLength))] - public string DefaultValue { get; set; } + public string? DefaultValue { get; set; } [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } public bool AllowBeNull { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemDto.cs index 3e7116cf7..3ca757a27 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemDto.cs @@ -5,13 +5,13 @@ namespace LINGYUN.Platform.Datas; public class DataItemDto : EntityDto { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; - public string DefaultValue { get; set; } + public string? DefaultValue { get; set; } - public string Description { get; set; } + public string? Description { get; set; } public bool AllowBeNull { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataByNameInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataByNameInput.cs index 6a669c2aa..f1aa16630 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataByNameInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataByNameInput.cs @@ -7,5 +7,5 @@ public class GetDataByNameInput { [Required] [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataListInput.cs index e5ba3c294..d35e7811d 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataListInput.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Platform.Datas; public class GetDataListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentDto.cs index 6303bd3eb..987572994 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentDto.cs @@ -4,7 +4,7 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Platform.Feedbacks; public class FeedbackAttachmentDto : CreationAuditedEntityDto { - public string Name { get; set; } - public string Url { get; set; } + public string Name { get; set; } = default!; + public string Url { get; set; } = default!; public long Size { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentGetInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentGetInput.cs index 5592d7756..e2576b375 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentGetInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentGetInput.cs @@ -10,5 +10,5 @@ public class FeedbackAttachmentGetInput [Required] [DynamicStringLength(typeof(FeedbackAttachmentConsts), nameof(FeedbackAttachmentConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentTempFileCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentTempFileCreateDto.cs index 5b92490a9..a4416e422 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentTempFileCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentTempFileCreateDto.cs @@ -1,6 +1,6 @@ namespace LINGYUN.Platform.Feedbacks; public class FeedbackAttachmentTempFileCreateDto { - public string Path { get; set; } - public string Id { get; set; } + public string Path { get; set; } = default!; + public string Id { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentTempFileDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentTempFileDto.cs index 2ebae2d07..400c3d1af 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentTempFileDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentTempFileDto.cs @@ -1,7 +1,7 @@ namespace LINGYUN.Platform.Feedbacks; public class FeedbackAttachmentTempFileDto { - public string Path { get; set; } - public string Id { get; set; } + public string Path { get; set; } = default!; + public string Id { get; set; } = default!; public long Size { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentUploadInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentUploadInput.cs index d0a223c73..59a69cdf2 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentUploadInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackAttachmentUploadInput.cs @@ -1,4 +1,5 @@ -using Volo.Abp.Auditing; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Auditing; using Volo.Abp.Content; using Volo.Abp.Validation; @@ -6,7 +7,8 @@ namespace LINGYUN.Platform.Feedbacks; public class FeedbackAttachmentUploadInput { + [Required] [DisableAuditing] [DisableValidation] - public IRemoteStreamContent File { get; set; } + public IRemoteStreamContent File { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentCreateDto.cs index 6e97fbad4..5bd36da5f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentCreateDto.cs @@ -6,5 +6,5 @@ public class FeedbackCommentCreateDto : FeedbackCommentCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(FeedbackCommentConsts), nameof(FeedbackCommentConsts.MaxCapacityLength))] - public string Capacity { get; set; } + public string Capacity { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentCreateOrUpdateDto.cs index ab771a86c..4f6e5569c 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentCreateOrUpdateDto.cs @@ -6,5 +6,5 @@ public abstract class FeedbackCommentCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(FeedbackCommentConsts), nameof(FeedbackCommentConsts.MaxContentLength))] - public string Content { get; set; } + public string Content { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentDto.cs index bb3390bea..f46d2d449 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentDto.cs @@ -4,5 +4,5 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Platform.Feedbacks; public class FeedbackCommentDto : AuditedEntityDto { - public string Content { get; set; } + public string Content { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentUpdateDto.cs index f05c19e33..1958b88e9 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCommentUpdateDto.cs @@ -3,5 +3,5 @@ namespace LINGYUN.Platform.Feedbacks; public class FeedbackCommentUpdateDto : FeedbackCommentCreateOrUpdateDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCreateDto.cs index 7c657e5c9..e0877a538 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackCreateDto.cs @@ -7,11 +7,11 @@ public class FeedbackCreateDto { [Required] [DynamicStringLength(typeof(FeedbackConsts), nameof(FeedbackConsts.MaxContentLength))] - public string Content { get; set; } + public string Content { get; set; } = default!; [Required] [DynamicStringLength(typeof(FeedbackConsts), nameof(FeedbackConsts.MaxCategoryLength))] - public string Category { get; set; } + public string Category { get; set; } = default!; - public List Attachments { get; set; } + public List? Attachments { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackDto.cs index bfe1646fa..0d0c8fd29 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackDto.cs @@ -5,9 +5,9 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Platform.Feedbacks; public class FeedbackDto : ExtensibleAuditedEntityDto { - public string Content { get; set; } - public string Category { get; set; } + public string Content { get; set; } = default!; + public string Category { get; set; } = default!; public FeedbackStatus Status { get; set; } - public List Comments { get; set; } - public List Attachments { get; set; } + public List Comments { get; set; } = default!; + public List? Attachments { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackGetListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackGetListInput.cs index b6c2a0e0b..225e1dfc8 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackGetListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Feedbacks/Dto/FeedbackGetListInput.cs @@ -3,7 +3,7 @@ namespace LINGYUN.Platform.Feedbacks; public class FeedbackGetListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } - public string Category { get; set; } + public string? Filter { get; set; } + public string? Category { get; set; } public FeedbackStatus? Status { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/GetLayoutListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/GetLayoutListInput.cs index b34cdb349..c361be2d8 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/GetLayoutListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/GetLayoutListInput.cs @@ -6,8 +6,8 @@ namespace LINGYUN.Platform.Layouts; public class GetLayoutListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string? Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateDto.cs index bd615ade8..bc1bc0b65 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateDto.cs @@ -11,5 +11,5 @@ public class LayoutCreateDto : LayoutCreateOrUpdateDto [Required] [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string Framework { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateOrUpdateDto.cs index ada68768a..96ec91070 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateOrUpdateDto.cs @@ -8,19 +8,19 @@ public class LayoutCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } [Required] [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxPathLength))] - public string Path { get; set; } + public string Path { get; set; } = default!; [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxRedirectLength))] - public string Redirect { get; set; } + public string? Redirect { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs index 10eae3a02..a72cc2b36 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs @@ -8,7 +8,7 @@ public class LayoutDto : RouteDto /// /// 框架 /// - public string Framework { get; set; } + public string Framework { get; set; } = default!; /// /// 约定的Meta采用哪种数据字典,主要是约束路由必须字段的一致性 /// diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/GetMenuInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/GetMenuInput.cs index 498737f79..fb6cd04d6 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/GetMenuInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/GetMenuInput.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Platform.Menus; public class GetMenuInput { [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string? Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateOrUpdateDto.cs index 3ded986ad..bae5746a5 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateOrUpdateDto.cs @@ -12,25 +12,25 @@ public class MenuCreateOrUpdateDto [Required] [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } [Required] [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxPathLength))] - public string Path { get; set; } + public string Path { get; set; } = default!; [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxRedirectLength))] - public string Redirect { get; set; } + public string? Redirect { get; set; } [Required] [DynamicStringLength(typeof(MenuConsts), nameof(MenuConsts.MaxComponentLength))] - public string Component { get; set; } + public string Component { get; set; } = default!; public bool IsPublic { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuDto.cs index 6bf874365..8fa3660d4 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuDto.cs @@ -9,15 +9,15 @@ public class MenuDto : RouteDto /// /// 菜单编号 /// - public string Code { get; set; } + public string Code { get; set; } = default!; /// /// 菜单布局页 /// - public string Component { get; set; } + public string Component { get; set; } = default!; /// /// 框架 /// - public string Framework { get; set; } + public string Framework { get; set; } = default!; /// /// 父节点 /// diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs index fa0b6218f..7b2fdc9eb 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs @@ -8,15 +8,15 @@ namespace LINGYUN.Platform.Menus; public class MenuGetAllInput : ISortedResultRequest { [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string? Framework { get; set; } - public string Filter { get; set; } + public string? Filter { get; set; } public bool Reverse { get; set; } public Guid? ParentId { get; set; } - public string Sorting { get; set; } + public string? Sorting { get; set; } public Guid? LayoutId { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByRoleInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByRoleInput.cs index c2118d880..9faab3e42 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByRoleInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByRoleInput.cs @@ -8,8 +8,8 @@ public class MenuGetByRoleInput { [Required] [StringLength(80)] - public string Role { get; set; } + public string Role { get; set; } = default!; [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string? Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByUserInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByUserInput.cs index 50c181c90..d2aa9c7a3 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByUserInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByUserInput.cs @@ -13,5 +13,5 @@ public class MenuGetByUserInput public string[] Roles { get; set; } = new string[0]; [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string? Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs index b3c3511c1..db3e2a621 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs @@ -8,9 +8,9 @@ namespace LINGYUN.Platform.Menus; public class MenuGetListInput : PagedAndSortedResultRequestDto { [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string? Framework { get; set; } - public string Filter { get; set; } + public string? Filter { get; set; } public Guid? ParentId { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuItemDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuItemDto.cs index 507ade439..789eeb57e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuItemDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuItemDto.cs @@ -8,11 +8,11 @@ public class MenuItemDto : RouteDto /// /// 菜单编号 /// - public string Code { get; set; } + public string Code { get; set; } = default!; /// /// 菜单组件 /// - public string Component { get; set; } + public string Component { get; set; } = default!; /// /// 子菜单列表 /// diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuInput.cs index d35fa7121..58cffe785 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuInput.cs @@ -10,10 +10,10 @@ public class RoleMenuInput { [Required] [StringLength(80)] - public string RoleName { get; set; } + public string RoleName { get; set; } = default!; [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string? Framework { get; set; } public Guid? StartupMenuId { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuStartupInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuStartupInput.cs index f2294dfb4..2431d7c35 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuStartupInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuStartupInput.cs @@ -8,8 +8,8 @@ public class RoleMenuStartupInput { [Required] [StringLength(80)] - public string RoleName { get; set; } + public string RoleName { get; set; } = default!; [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string? Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuCreateDto.cs index 7326d0268..058bc8237 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuCreateDto.cs @@ -9,5 +9,5 @@ public class UserFavoriteMenuCreateDto : UserFavoriteMenuCreateOrUpdateDto [Required] [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string Framework { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuCreateOrUpdateDto.cs index 3814d0de5..346f2c20b 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuCreateOrUpdateDto.cs @@ -10,11 +10,11 @@ public abstract class UserFavoriteMenuCreateOrUpdateDto public Guid MenuId { get; set; } [DynamicStringLength(typeof(UserFavoriteMenuConsts), nameof(UserFavoriteMenuConsts.MaxColorLength))] - public string Color { get; set; } + public string? Color { get; set; } [DynamicStringLength(typeof(UserFavoriteMenuConsts), nameof(UserFavoriteMenuConsts.MaxAliasNameLength))] - public string AliasName { get; set; } + public string? AliasName { get; set; } [DynamicStringLength(typeof(UserFavoriteMenuConsts), nameof(UserFavoriteMenuConsts.MaxIconLength))] - public string Icon { get; set; } + public string? Icon { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuDto.cs index 7087df150..21fd46d61 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuDto.cs @@ -9,17 +9,17 @@ public class UserFavoriteMenuDto : AuditedEntityDto public Guid UserId { get; set; } - public string AliasName { get; set; } + public string? AliasName { get; set; } - public string Color { get; set; } + public string? Color { get; set; } - public string Framework { get; set; } + public string? Framework { get; set; } - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; - public string Path { get; set; } + public string Path { get; set; } = default!; - public string Icon { get; set; } + public string? Icon { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuGetListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuGetListInput.cs index e917c4e57..c95a9564b 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuGetListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuGetListInput.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Platform.Menus; public class UserFavoriteMenuGetListInput { [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string? Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuUpdateDto.cs index 90a0e702d..237137f0d 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserFavoriteMenuUpdateDto.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Platform.Menus; public class UserFavoriteMenuUpdateDto : UserFavoriteMenuCreateOrUpdateDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuInput.cs index 2ede9ae62..43333464e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuInput.cs @@ -13,7 +13,7 @@ public class UserMenuInput [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string? Framework { get; set; } public Guid? StartupMenuId { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuStartupInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuStartupInput.cs index 16bc7337a..a114097b2 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuStartupInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuStartupInput.cs @@ -10,5 +10,5 @@ public class UserMenuStartupInput [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + public string? Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageAttachmentDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageAttachmentDto.cs index f65a9bbc3..baee4f27c 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageAttachmentDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageAttachmentDto.cs @@ -6,11 +6,11 @@ public class EmailMessageAttachmentDto { [Required] [DynamicStringLength(typeof(EmailMessageAttachmentConsts), nameof(EmailMessageAttachmentConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] [DynamicStringLength(typeof(EmailMessageAttachmentConsts), nameof(EmailMessageAttachmentConsts.MaxNameLength))] - public string BlobName { get; set; } + public string BlobName { get; set; } = default!; public long Size { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageCreateDto.cs index 038eba704..5ba316995 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageCreateDto.cs @@ -13,21 +13,21 @@ public class EmailMessageCreateDto : IHasExtraProperties { [Required] [DynamicStringLength(typeof(MessageConsts), nameof(MessageConsts.MaxReceiverLength))] - public string To { get; set; } + public string To { get; set; } = default!; [Required] - public string Content { get; set; } + public string Content { get; set; } = default!; [DynamicStringLength(typeof(EmailMessageConsts), nameof(EmailMessageConsts.MaxFromLength))] - public string From { get; set; } + public string? From { get; set; } [DynamicStringLength(typeof(EmailMessageConsts), nameof(EmailMessageConsts.MaxSubjectLength))] - public string Subject { get; set; } + public string? Subject { get; set; } public bool IsBodyHtml { get; set; } = true; [DynamicStringLength(typeof(MessageConsts), nameof(MessageConsts.MaxReceiverLength))] - public string CC { get; set; } + public string? CC { get; set; } public bool Normalize { get; set; } @@ -36,29 +36,31 @@ public class EmailMessageCreateDto : IHasExtraProperties public DeliveryNotificationOptions? DeliveryNotificationOptions { get; set; } [DisableAuditing] - public IRemoteStreamContent[] Attachments { get; set; } + public IRemoteStreamContent[]? Attachments { get; set; } - public List Headers { get; set; } + public List? Headers { get; set; } public ExtraPropertyDictionary ExtraProperties { get; set; } public EmailMessageCreateDto() { - + ExtraProperties = new ExtraPropertyDictionary(); } public EmailMessageCreateDto( [NotNull] string to, - [NotNull] string content, - string from = null, - string subject = null, + [CanBeNull] string? content, + string? from = null, + string? subject = null, bool isBodyHtml = true, - string cc = null) + string? cc = null) { To = to; - Content = content; + Content = content ?? ""; From = from; Subject = subject; IsBodyHtml = isBodyHtml; CC = cc; + + ExtraProperties = new ExtraPropertyDictionary(); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageDto.cs index 78f9c4063..646934e22 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageDto.cs @@ -6,14 +6,14 @@ namespace LINGYUN.Platform.Messages; public class EmailMessageDto : MessageDto { - public string From { get; set; } - public string Subject { get; set; } + public string? From { get; set; } + public string? Subject { get; set; } public bool IsBodyHtml { get; set; } - public string CC { get; set; } + public string? CC { get; set; } public bool Normalize { get; set; } public MailPriority? Priority { get; set; } public TransferEncoding? BodyTransferEncoding { get; set; } public DeliveryNotificationOptions? DeliveryNotificationOptions { get; set; } - public ICollection Attachments { get; set; } - public List Headers { get; set; } + public ICollection? Attachments { get; set; } + public List? Headers { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageGetListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageGetListInput.cs index cd13a3c91..bada6f593 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageGetListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageGetListInput.cs @@ -5,11 +5,11 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Platform.Messages; public class EmailMessageGetListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } - public string EmailAddress { get; set; } - public string Content { get; set; } - public string From { get; set; } - public string Subject { get; set; } + public string? Filter { get; set; } + public string? EmailAddress { get; set; } + public string? Content { get; set; } + public string? From { get; set; } + public string? Subject { get; set; } public MessageStatus? Status { get; set; } public MailPriority? Priority { get; set; } public DateTime? BeginSendTime { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageHeaderDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageHeaderDto.cs index 789914503..3aa3c89be 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageHeaderDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/EmailMessageHeaderDto.cs @@ -7,11 +7,11 @@ public class EmailMessageHeaderDto { [Required] [DynamicStringLength(typeof(EmailMessageHeaderConsts), nameof(EmailMessageHeaderConsts.MaxKeyLength))] - public string Key { get; set; } + public string Key { get; set; } = default!; [Required] [DynamicStringLength(typeof(EmailMessageHeaderConsts), nameof(EmailMessageHeaderConsts.MaxValueLength))] - public string Value { get; set; } + public string Value { get; set; } = default!; public EmailMessageHeaderDto() { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/MessageDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/MessageDto.cs index c0f1621e3..5c3e3ad28 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/MessageDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/MessageDto.cs @@ -5,12 +5,12 @@ namespace LINGYUN.Platform.Messages; public abstract class MessageDto : AuditedEntityDto { public Guid? UserId { get; set; } - public string Sender { get; set; } - public string Provider { get; set; } - public string Receiver { get; set; } - public string Content { get; set; } + public string? Sender { get; set; } + public string? Provider { get; set; } + public string Receiver { get; set; } = default!; + public string Content { get; set; } = default!; public DateTime? SendTime { get; set; } public int SendCount { get; set; } public MessageStatus Status { get; set; } - public string Reason { get; set; } + public string? Reason { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/SmsMessageCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/SmsMessageCreateDto.cs index d19e335b9..3d76d9714 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/SmsMessageCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/SmsMessageCreateDto.cs @@ -8,16 +8,16 @@ public class SmsMessageCreateDto : IHasExtraProperties { [Required] [DynamicStringLength(typeof(MessageConsts), nameof(MessageConsts.MaxReceiverLength))] - public string PhoneNumber { get; set; } + public string PhoneNumber { get; set; } = default!; [Required] - public string Text { get; set; } + public string Text { get; set; } = default!; public ExtraPropertyDictionary ExtraProperties { get; set; } public SmsMessageCreateDto() { - + ExtraProperties = new ExtraPropertyDictionary(); } public SmsMessageCreateDto( @@ -26,5 +26,7 @@ public class SmsMessageCreateDto : IHasExtraProperties { PhoneNumber = phoneNumber; Text = text; + + ExtraProperties = new ExtraPropertyDictionary(); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/SmsMessageGetListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/SmsMessageGetListInput.cs index 99c632a01..92cf50b62 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/SmsMessageGetListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Messages/Dto/SmsMessageGetListInput.cs @@ -4,8 +4,8 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Platform.Messages; public class SmsMessageGetListInput : PagedAndSortedResultRequestDto { - public string PhoneNumber { get; set; } - public string Content { get; set; } + public string? PhoneNumber { get; set; } + public string? Content { get; set; } public MessageStatus? Status { get; set; } public DateTime? BeginSendTime { get; set; } public DateTime? EndSendTime { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobDownloadInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobDownloadInput.cs index 0c26c9d1b..e66a1e5d6 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobDownloadInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobDownloadInput.cs @@ -7,5 +7,5 @@ public class PackageBlobDownloadInput { [Required] [DynamicMaxLength(typeof(PackageBlobConsts), nameof(PackageBlobConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobDto.cs index 2904d1983..76904c47a 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobDto.cs @@ -6,16 +6,16 @@ namespace LINGYUN.Platform.Packages; public class PackageBlobDto : CreationAuditedEntityDto, IHasExtraProperties { - public string Name { get; set; } - public string Url { get; set; } + public string Name { get; set; } = default!; + public string? Url { get; set; } public long? Size { get; set; } - public string Summary { get; set; } + public string? Summary { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } - public string License { get; set; } - public string Authors { get; set; } - public string SHA256 { get; set; } - public string ContentType { get; set; } + public string? License { get; set; } + public string? Authors { get; set; } + public string? SHA256 { get; set; } + public string? ContentType { get; set; } public int DownloadCount { get; set; } - public ExtraPropertyDictionary ExtraProperties { get; set; } + public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary(); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobRemoveDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobRemoveDto.cs index a9f7c80db..de0c337d5 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobRemoveDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobRemoveDto.cs @@ -7,5 +7,5 @@ public class PackageBlobRemoveDto { [Required] [DynamicMaxLength(typeof(PackageBlobConsts), nameof(PackageBlobConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobUploadDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobUploadDto.cs index 4d3205caa..edb7d6a46 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobUploadDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageBlobUploadDto.cs @@ -10,27 +10,27 @@ public class PackageBlobUploadDto { [Required] [DynamicMaxLength(typeof(PackageBlobConsts), nameof(PackageBlobConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; public long? Size { get; set; } [DynamicMaxLength(typeof(PackageBlobConsts), nameof(PackageBlobConsts.MaxSummaryLength))] - public string Summary { get; set; } + public string? Summary { get; set; } [DynamicMaxLength(typeof(PackageBlobConsts), nameof(PackageBlobConsts.MaxContentTypeLength))] - public string ContentType { get; set; } + public string? ContentType { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } [DynamicMaxLength(typeof(PackageBlobConsts), nameof(PackageBlobConsts.MaxLicenseLength))] - public string License { get; set; } + public string? License { get; set; } [DynamicMaxLength(typeof(PackageBlobConsts), nameof(PackageBlobConsts.MaxAuthorsLength))] - public string Authors { get; set; } + public string? Authors { get; set; } [Required] [DisableAuditing] - public IRemoteStreamContent File { get; set; } + public IRemoteStreamContent File { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageCreateDto.cs index e6c6f6adc..a42b15e73 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageCreateDto.cs @@ -9,11 +9,11 @@ public class PackageCreateDto : PackageCreateOrUpdateDto /// [Required] [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 版本 /// [Required] [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxVersionLength))] - public string Version { get; set; } + public string Version { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageCreateOrUpdateDto.cs index a3c271ce4..92b7c76d7 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageCreateOrUpdateDto.cs @@ -10,19 +10,19 @@ public abstract class PackageCreateOrUpdateDto /// [Required] [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxNoteLength))] - public string Note { get; set; } + public string Note { get; set; } = default!; /// /// 描述 /// [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } /// /// 强制更新 /// public bool ForceUpdate { get; set; } [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxAuthorsLength))] - public string Authors { get; set; } + public string? Authors { get; set; } public PackageLevel Level { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageDto.cs index 33224e143..0dc01c4dd 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageDto.cs @@ -7,29 +7,29 @@ namespace LINGYUN.Platform.Packages; public class PackageDto : ExtensibleAuditedEntityDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 版本说明 /// - public string Note { get; set; } + public string Note { get; set; } = default!; /// /// 版本 /// - public string Version { get; set; } + public string Version { get; set; } = default!; /// /// 描述 /// - public string Description { get; set; } + public string? Description { get; set; } /// /// 强制更新 /// public bool ForceUpdate { get; set; } - public string Authors { get; set; } + public string? Authors { get; set; } public PackageLevel Level { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetLatestInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetLatestInput.cs index ea6833373..e5708c30e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetLatestInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetLatestInput.cs @@ -7,8 +7,8 @@ public class PackageGetLatestInput { [Required] [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxVersionLength))] - public string Version { get; set; } + public string? Version { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetPagedListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetPagedListInput.cs index 92c81bbc6..88fe243c5 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetPagedListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetPagedListInput.cs @@ -5,22 +5,22 @@ namespace LINGYUN.Platform.Packages; public class PackageGetPagedListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxNameLength))] - public string Name { get; set; } + public string? Name { get; set; } [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxNoteLength))] - public string Note { get; set; } + public string? Note { get; set; } [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxVersionLength))] - public string Version { get; set; } + public string? Version { get; set; } [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } public bool? ForceUpdate { get; set; } [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxAuthorsLength))] - public string Authors { get; set; } + public string? Authors { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageUpdateDto.cs index beea3bfee..af37c33fa 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageUpdateDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Platform.Packages; public class PackageUpdateDto : PackageCreateOrUpdateDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/IPackageAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/IPackageAppService.cs index 6a8e6bc6a..b379989db 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/IPackageAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/IPackageAppService.cs @@ -13,7 +13,7 @@ public interface IPackageAppService : PackageCreateDto, PackageUpdateDto> { - Task GetLatestAsync(PackageGetLatestInput input); + Task GetLatestAsync(PackageGetLatestInput input); Task UploadBlobAsync( Guid id, diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseCreateDto.cs index f2e2fa198..fc7743e13 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseCreateDto.cs @@ -10,5 +10,5 @@ public class EnterpriseCreateDto : EnterpriseCreateOrUpdateDto /// [Required] [DynamicStringLength(typeof(EnterpriseConsts), nameof(EnterpriseConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseCreateOrUpdateDto.cs index 777776f85..0c6e20ecb 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseCreateOrUpdateDto.cs @@ -13,37 +13,37 @@ public abstract class EnterpriseCreateOrUpdateDto /// 英文名称 /// [DynamicStringLength(typeof(EnterpriseConsts), nameof(EnterpriseConsts.MaxEnglishNameLength))] - public string EnglishName { get; set; } + public string? EnglishName { get; set; } /// /// Logo /// [DynamicStringLength(typeof(EnterpriseConsts), nameof(EnterpriseConsts.MaxLogoLength))] - public string Logo { get; set; } + public string? Logo { get; set; } /// /// 地址 /// [DynamicStringLength(typeof(EnterpriseConsts), nameof(EnterpriseConsts.MaxAddressLength))] - public string Address { get; set; } + public string? Address { get; set; } /// /// 法人代表 /// [DynamicStringLength(typeof(EnterpriseConsts), nameof(EnterpriseConsts.MaxLegalManLength))] - public string LegalMan { get; set; } + public string? LegalMan { get; set; } /// /// 税务登记号 /// [DynamicStringLength(typeof(EnterpriseConsts), nameof(EnterpriseConsts.MaxTaxCodeLength))] - public string TaxCode { get; set; } + public string? TaxCode { get; set; } /// /// 组织机构代码 /// [DynamicStringLength(typeof(EnterpriseConsts), nameof(EnterpriseConsts.MaxOrganizationCodeLength))] - public string OrganizationCode { get; set; } + public string? OrganizationCode { get; set; } /// /// 注册代码 /// [DynamicStringLength(typeof(EnterpriseConsts), nameof(EnterpriseConsts.MaxRegistrationCodeLength))] - public string RegistrationCode { get; set; } + public string? RegistrationCode { get; set; } /// /// 注册日期 /// diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseDto.cs index 1072e502e..692642cc1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseDto.cs @@ -7,15 +7,15 @@ namespace LINGYUN.Platform.Portal; public class EnterpriseDto : ExtensibleAuditedEntityDto, IHasConcurrencyStamp { public Guid? TenantId { get; set; } - public string Name { get; set; } - public string EnglishName { get; set; } - public string Logo { get; set; } - public string Address { get; set; } - public string LegalMan { get; set; } - public string TaxCode { get; set; } - public string OrganizationCode { get; set; } - public string RegistrationCode { get; set; } + public string Name { get; set; } = default!; + public string? EnglishName { get; set; } + public string? Logo { get; set; } + public string? Address { get; set; } + public string? LegalMan { get; set; } + public string? TaxCode { get; set; } + public string? OrganizationCode { get; set; } + public string? RegistrationCode { get; set; } public DateTime? RegistrationDate { get; set; } public DateTime? ExpirationDate { get; set; } - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseGetListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseGetListInput.cs index ecbea0869..081ef8931 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseGetListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseGetListInput.cs @@ -5,7 +5,7 @@ namespace LINGYUN.Platform.Portal; public class EnterpriseGetListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } public DateTime? BeginRegistrationDate { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseUpdateDto.cs index fa74414bb..c096fd92d 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Portal/Dto/EnterpriseUpdateDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Platform.Portal; public class EnterpriseUpdateDto : EnterpriseCreateOrUpdateDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Routes/Dto/RouteDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Routes/Dto/RouteDto.cs index 2e3e4932e..227e33a86 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Routes/Dto/RouteDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Routes/Dto/RouteDto.cs @@ -9,25 +9,25 @@ public class RouteDto : EntityDto /// /// 路径 /// - public string Path { get; set; } + public string Path { get; set; } = default!; /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 显示名称 /// - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; /// /// 说明 /// - public string Description { get; set; } + public string? Description { get; set; } /// /// 重定向路径 /// - public string Redirect { get; set; } + public string? Redirect { get; set; } /// /// 路由的一些辅助元素,取决于数据字典的设计 /// - public Dictionary Meta { get; set; } + public Dictionary Meta { get; set; } = new Dictionary(); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs index dbd934de4..78bae7d75 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs @@ -35,7 +35,7 @@ public class DataAppService : PlatformApplicationServiceBase, IDataAppService if (children.Any()) { var lastChildren = children.OrderBy(x => x.Code).FirstOrDefault(); - code = CodeNumberGenerator.CalculateNextCode(lastChildren.Code); + code = CodeNumberGenerator.CalculateNextCode(lastChildren?.Code); } else { @@ -57,7 +57,7 @@ public class DataAppService : PlatformApplicationServiceBase, IDataAppService ); data = await DataRepository.InsertAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(data); } @@ -78,7 +78,8 @@ public class DataAppService : PlatformApplicationServiceBase, IDataAppService public async virtual Task GetAsync(string name) { - var data = await DataRepository.FindByNameAsync(name); + var data = await DataRepository.FindByNameAsync(name) + ?? throw new UserFriendlyException(L["DataNotFound", name]); return ObjectMapper.Map(data); } @@ -118,7 +119,7 @@ public class DataAppService : PlatformApplicationServiceBase, IDataAppService data.ParentId = input.ParentId; data = await DataRepository.UpdateAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(data); } @@ -146,7 +147,7 @@ public class DataAppService : PlatformApplicationServiceBase, IDataAppService } data = await DataRepository.UpdateAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(data); } @@ -176,7 +177,7 @@ public class DataAppService : PlatformApplicationServiceBase, IDataAppService dataItem.AllowBeNull = input.AllowBeNull; await DataRepository.UpdateAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(PlatformPermissions.DataDictionary.ManageItems)] @@ -199,7 +200,7 @@ public class DataAppService : PlatformApplicationServiceBase, IDataAppService input.AllowBeNull); await DataRepository.UpdateAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(PlatformPermissions.DataDictionary.ManageItems)] @@ -209,6 +210,6 @@ public class DataAppService : PlatformApplicationServiceBase, IDataAppService data.RemoveItem(name); await DataRepository.UpdateAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Feedbacks/FeedbackAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Feedbacks/FeedbackAppService.cs index 17e42ffea..b919ff614 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Feedbacks/FeedbackAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Feedbacks/FeedbackAppService.cs @@ -51,7 +51,7 @@ public class FeedbackAppService : PlatformApplicationServiceBase, IFeedbackAppSe feedback = await _feedbackRepository.InsertAsync(feedback); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(feedback); } @@ -63,7 +63,7 @@ public class FeedbackAppService : PlatformApplicationServiceBase, IFeedbackAppSe await _feedbackRepository.DeleteAsync(feedback); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(PlatformPermissions.Feedback.Default)] @@ -100,8 +100,8 @@ public class FeedbackAppService : PlatformApplicationServiceBase, IFeedbackAppSe return expression .AndIf(Input.Status.HasValue, x => x.Status == Input.Status) .AndIf(!Input.Category.IsNullOrWhiteSpace(), x => x.Category == Input.Category) - .AndIf(!Input.Filter.IsNullOrWhiteSpace(), x => x.Category.Contains(Input.Filter) || - x.Content.Contains(Input.Filter)); + .AndIf(!Input.Filter.IsNullOrWhiteSpace(), x => x.Category.Contains(Input.Filter!) || + x.Content.Contains(Input.Filter!)); } } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Feedbacks/FeedbackAttachmentAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Feedbacks/FeedbackAttachmentAppService.cs index ab7e0042c..fa9aeaf71 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Feedbacks/FeedbackAttachmentAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Feedbacks/FeedbackAttachmentAppService.cs @@ -52,12 +52,14 @@ public class FeedbackAttachmentAppService : PlatformApplicationServiceBase, IFee } var attachment = feedback.FindAttachment(input.Name); + if (attachment != null) + { + feedback.RemoveAttachment(attachment.Name); - feedback.RemoveAttachment(attachment.Name); - - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); - await _feedbackAttachmentManager.DeleteAsync(attachment); + await _feedbackAttachmentManager.DeleteAsync(attachment); + } } protected async virtual Task GetFeedbackAttachmentAsync(FeedbackAttachmentGetInput input) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs index 3dc5735f1..fcf621294 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs @@ -40,7 +40,7 @@ public class LayoutAppService : PlatformApplicationServiceBase, ILayoutAppServic CurrentTenant.Id); layout = await LayoutRepository.InsertAsync(layout); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(layout); } @@ -56,7 +56,7 @@ public class LayoutAppService : PlatformApplicationServiceBase, ILayoutAppServic //} await LayoutRepository.DeleteAsync(layout); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(Guid id) @@ -117,7 +117,7 @@ public class LayoutAppService : PlatformApplicationServiceBase, ILayoutAppServic layout.Redirect = input.Redirect; } layout = await LayoutRepository.UpdateAsync(layout); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(layout); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs index 09b6e3b24..464194693 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs @@ -99,9 +99,9 @@ public class MenuAppService : PlatformApplicationServiceBase, IMenuAppService var count = await MenuRepository.GetCountAsync(input.Filter, input.Framework, input.ParentId, input.LayoutId); var menus = await MenuRepository.GetListAsync( - input.Filter, input.Sorting, - input.Framework, input.ParentId, input.LayoutId, - input.SkipCount, input.MaxResultCount); + input.Filter, input.Framework, + input.ParentId, input.LayoutId, + input.Sorting, input.SkipCount, input.MaxResultCount); return new PagedResultDto(count, ObjectMapper.Map, List>(menus)); @@ -129,7 +129,7 @@ public class MenuAppService : PlatformApplicationServiceBase, IMenuAppService // 利用布局约定的数据字典来校验必须的路由元数据,元数据的加入是为了适配多端路由 foreach (var dataItem in data.Items) { - if (!input.Meta.TryGetValue(dataItem.Name, out object meta)) + if (!input.Meta.TryGetValue(dataItem.Name, out var meta)) { if (!dataItem.AllowBeNull) { @@ -147,7 +147,7 @@ public class MenuAppService : PlatformApplicationServiceBase, IMenuAppService } } - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(menu); } @@ -162,7 +162,7 @@ public class MenuAppService : PlatformApplicationServiceBase, IMenuAppService var data = await DataRepository.GetAsync(layout.DataId); foreach (var dataItem in data.Items) { - if (!input.Meta.TryGetValue(dataItem.Name, out object meta)) + if (!input.Meta.TryGetValue(dataItem.Name, out var meta)) { if (!dataItem.AllowBeNull) { @@ -222,7 +222,7 @@ public class MenuAppService : PlatformApplicationServiceBase, IMenuAppService menu.IsPublic = input.IsPublic; await MenuManager.UpdateAsync(menu); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(menu); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/UserFavoriteMenuAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/UserFavoriteMenuAppService.cs index 511c798e6..fe47c6697 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/UserFavoriteMenuAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/UserFavoriteMenuAppService.cs @@ -49,7 +49,7 @@ public class UserFavoriteMenuAppService : PlatformApplicationServiceBase, IUserF userFavoriteMenu = await UserFavoriteMenuRepository.InsertAsync(userFavoriteMenu); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(userFavoriteMenu); } @@ -79,7 +79,7 @@ public class UserFavoriteMenuAppService : PlatformApplicationServiceBase, IUserF userFavoriteMenu = await UserFavoriteMenuRepository.InsertAsync(userFavoriteMenu); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(userFavoriteMenu); } @@ -127,7 +127,7 @@ public class UserFavoriteMenuAppService : PlatformApplicationServiceBase, IUserF userFavoriteMenu = await UserFavoriteMenuRepository.UpdateAsync(userFavoriteMenu); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(userFavoriteMenu); } @@ -140,7 +140,7 @@ public class UserFavoriteMenuAppService : PlatformApplicationServiceBase, IUserF userFavoriteMenu = await UserFavoriteMenuRepository.UpdateAsync(userFavoriteMenu); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(userFavoriteMenu); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/EmailMessageAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/EmailMessageAppService.cs index 6adca67d1..897bf665e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/EmailMessageAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/EmailMessageAppService.cs @@ -29,7 +29,7 @@ public class EmailMessageAppService : PlatformApplicationServiceBase, IEmailMess await _emailMessageRepository.DeleteAsync(emailMessage); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(Guid id) @@ -65,7 +65,7 @@ public class EmailMessageAppService : PlatformApplicationServiceBase, IEmailMess await _emailMessageRepository.UpdateAsync(emailMessage); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } private class EmailMessageGetListSpecification : Volo.Abp.Specifications.Specification @@ -81,13 +81,13 @@ public class EmailMessageAppService : PlatformApplicationServiceBase, IEmailMess Expression> expression = _ => true; return expression - .AndIf(!Input.EmailAddress.IsNullOrWhiteSpace(), x => x.Receiver.Contains(Input.EmailAddress)) - .AndIf(!Input.Subject.IsNullOrWhiteSpace(), x => x.Subject.Contains(Input.Subject)) - .AndIf(!Input.Content.IsNullOrWhiteSpace(), x => x.Content.Contains(Input.Content)) - .AndIf(!Input.From.IsNullOrWhiteSpace(), x => x.From.Contains(Input.From)) - .AndIf(!Input.Filter.IsNullOrWhiteSpace(), x => x.From.Contains(Input.Filter) || - x.Receiver.Contains(Input.Filter) || x.Content.Contains(Input.Filter) || - x.Subject.Contains(Input.Filter)) + .AndIf(!Input.EmailAddress.IsNullOrWhiteSpace(), x => x.Receiver.Contains(Input.EmailAddress!)) + .AndIf(!Input.Subject.IsNullOrWhiteSpace(), x => x.Subject!.Contains(Input.Subject!)) + .AndIf(!Input.Content.IsNullOrWhiteSpace(), x => x.Content.Contains(Input.Content!)) + .AndIf(!Input.From.IsNullOrWhiteSpace(), x => x.From!.Contains(Input.From!)) + .AndIf(!Input.Filter.IsNullOrWhiteSpace(), x => x.From!.Contains(Input.Filter!) || + x.Receiver.Contains(Input.Filter!) || x.Content.Contains(Input.Filter!) || + x.Subject!.Contains(Input.Filter!)) .AndIf(Input.Status.HasValue, x => x.Status == Input.Status) .AndIf(Input.Priority.HasValue, x => x.Priority == Input.Priority) .AndIf(Input.BeginSendTime.HasValue, x => x.SendTime >= Input.BeginSendTime) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/Integration/EmailMessageIntegrationService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/Integration/EmailMessageIntegrationService.cs index ec7b742bb..6c3ed9535 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/Integration/EmailMessageIntegrationService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/Integration/EmailMessageIntegrationService.cs @@ -52,13 +52,13 @@ public class EmailMessageIntegrationService : PlatformApplicationServiceBase, IE await _blobContainer.SaveAsync(attachmentName, attachmentStream, overrideExisting: true); - emailMessage.AddAttachment(attachment.FileName, attachmentName, attachmentStream.Length); + emailMessage.AddAttachment(attachment.FileName!, attachmentName, attachmentStream.Length); } } emailMessage = await _emailMessageRepository.InsertAsync(emailMessage); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(emailMessage); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/Integration/SmsMessageIntegrationService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/Integration/SmsMessageIntegrationService.cs index b467ff873..69c5429c9 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/Integration/SmsMessageIntegrationService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/Integration/SmsMessageIntegrationService.cs @@ -31,7 +31,7 @@ public class SmsMessageIntegrationService : PlatformApplicationServiceBase, ISms smsMessage = await _smsMessageRepository.InsertAsync(smsMessage); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(smsMessage); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/SmsMessageAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/SmsMessageAppService.cs index 27745631a..86c956269 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/SmsMessageAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Messages/SmsMessageAppService.cs @@ -29,7 +29,7 @@ public class SmsMessageAppService : PlatformApplicationServiceBase, ISmsMessageA await _smsMessageRepository.DeleteAsync(smsMessage); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(Guid id) @@ -65,7 +65,7 @@ public class SmsMessageAppService : PlatformApplicationServiceBase, ISmsMessageA await _smsMessageRepository.UpdateAsync(smsMessage); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } private class SmsMessageGetListSpecification : Volo.Abp.Specifications.Specification @@ -81,8 +81,8 @@ public class SmsMessageAppService : PlatformApplicationServiceBase, ISmsMessageA Expression> expression = _ => true; return expression - .AndIf(!Input.PhoneNumber.IsNullOrWhiteSpace(), x => x.Receiver.Contains(Input.PhoneNumber)) - .AndIf(!Input.Content.IsNullOrWhiteSpace(), x => x.Content.Contains(Input.Content)) + .AndIf(!Input.PhoneNumber.IsNullOrWhiteSpace(), x => x.Receiver.Contains(Input.PhoneNumber!)) + .AndIf(!Input.Content.IsNullOrWhiteSpace(), x => x.Content.Contains(Input.Content!)) .AndIf(Input.Status.HasValue, x => x.Status == Input.Status) .AndIf(Input.BeginSendTime.HasValue, x => x.SendTime >= Input.BeginSendTime) .AndIf(Input.EndSendTime.HasValue, x => x.SendTime <= Input.EndSendTime); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Packages/PackageAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Packages/PackageAppService.cs index 75f4376b9..707a2b792 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Packages/PackageAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Packages/PackageAppService.cs @@ -25,11 +25,11 @@ public class PackageAppService : PlatformApplicationServiceBase, IPackageAppServ _packageRepository = packageRepository; } - public async virtual Task GetLatestAsync(PackageGetLatestInput input) + public async virtual Task GetLatestAsync(PackageGetLatestInput input) { var package = await _packageRepository.FindLatestAsync(input.Name, input.Version); - return ObjectMapper.Map(package); + return ObjectMapper.Map(package); } [Authorize(PlatformPermissions.Package.Create)] @@ -57,7 +57,7 @@ public class PackageAppService : PlatformApplicationServiceBase, IPackageAppServ package = await _packageRepository.InsertAsync(package); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(package); } @@ -67,7 +67,7 @@ public class PackageAppService : PlatformApplicationServiceBase, IPackageAppServ { await _packageRepository.DeleteAsync(id); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(PlatformPermissions.Package.ManageBlobs)] @@ -93,7 +93,7 @@ public class PackageAppService : PlatformApplicationServiceBase, IPackageAppServ await _packageRepository.UpdateAsync(package); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(packageBlob); } @@ -106,26 +106,30 @@ public class PackageAppService : PlatformApplicationServiceBase, IPackageAppServ var package = await _packageRepository.GetAsync(id); var packageBlob = package.FindBlob(input.Name); + if (packageBlob != null) + { + await _blobManager.RemoveBlobAsync(package, packageBlob); - await _blobManager.RemoveBlobAsync(package, packageBlob); - - package.RemoveBlob(input.Name); + package.RemoveBlob(input.Name); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); + } } public async virtual Task DownloadBlobAsync(Guid id, PackageBlobDownloadInput input) { + var stream = Stream.Null; var package = await _packageRepository.GetAsync(id); var packageBlob = package.FindBlob(input.Name); - - Stream stream; - using (CurrentTenant.Change(null)) + if (packageBlob != null) { - stream = await _blobManager.DownloadBlobAsync(package, packageBlob); + using (CurrentTenant.Change(null)) + { + stream = await _blobManager.DownloadBlobAsync(package, packageBlob); + } } - return new RemoteStreamContent(stream, packageBlob.Name, packageBlob.ContentType); + return new RemoteStreamContent(stream, packageBlob?.Name, packageBlob?.ContentType); } public async virtual Task GetAsync(Guid id) @@ -164,7 +168,7 @@ public class PackageAppService : PlatformApplicationServiceBase, IPackageAppServ package = await _packageRepository.UpdateAsync(package); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(package); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Portal/EnterpriseAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Portal/EnterpriseAppService.cs index 970349e8d..9e0f3dab7 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Portal/EnterpriseAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Portal/EnterpriseAppService.cs @@ -69,7 +69,7 @@ public class EnterpriseAppService : protected async override Task MapToEntityAsync(EnterpriseUpdateDto updateInput, Enterprise entity) { - if (!string.Equals(entity.EnglishName, updateInput.EnglishName, StringComparison.InvariantCultureIgnoreCase)) + if (!string.IsNullOrWhiteSpace(updateInput.EnglishName) && !string.Equals(entity.EnglishName, updateInput.EnglishName, StringComparison.InvariantCultureIgnoreCase)) { if (await EnterpriseRepository.FindByNameAsync(updateInput.EnglishName) != null) { @@ -133,9 +133,9 @@ public class EnterpriseAppService : Expression> expression = _ => true; - expression = expression.AndIf(!input.Filter.IsNullOrWhiteSpace(), x => x.Name.Contains(input.Filter) || - x.EnglishName.Contains(input.Filter) || x.Address.Contains(input.Filter) || x.LegalMan.Contains(input.Filter) || - x.TaxCode.Contains(input.Filter)|| x.OrganizationCode.Contains(input.Filter) || x.RegistrationCode.Contains(input.Filter)); + expression = expression.AndIf(!input.Filter.IsNullOrWhiteSpace(), x => x.Name.Contains(input.Filter!) || + x.EnglishName!.Contains(input.Filter!) || x.Address!.Contains(input.Filter!) || x.LegalMan!.Contains(input.Filter!) || + x.TaxCode!.Contains(input.Filter!)|| x.OrganizationCode!.Contains(input.Filter!) || x.RegistrationCode!.Contains(input.Filter!)); expression = expression.AndIf(input.BeginRegistrationDate.HasValue, x => x.RegistrationDate >= input.BeginRegistrationDate); expression = expression.AndIf(input.EndRegistrationDate.HasValue, x => x.RegistrationDate <= input.EndRegistrationDate); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Feedbacks/FeedbackAttachmentTempFile.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Feedbacks/FeedbackAttachmentTempFile.cs index 1f85480a5..e2398ace9 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Feedbacks/FeedbackAttachmentTempFile.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Feedbacks/FeedbackAttachmentTempFile.cs @@ -1,7 +1,7 @@ namespace LINGYUN.Platform.Feedbacks; public class FeedbackAttachmentTempFile { - public string Path { get; set; } - public string Id { get; set; } + public string Path { get; set; } = default!; + public string Id { get; set; } = default!; public long Size { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json index 71190f6ed..de82f5384 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/en.json @@ -107,6 +107,7 @@ "Data:Items": "Data Items", "DuplicateData": "A data dictionary named {0} already exists!", "DuplicateDataItem": "A data dictionary entry named {0} already exists!", + "DataNotFound": "There is no data dictionary named {0}!", "DataItemNotFound": "There is no data dictionary entry named {0}!", "UnableRemoveHasChildNode": "Current data dictionary exists child node, cannot delete!", "DuplicateLayout": "A layout named {0} already exists!", diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json index 98018d49a..af0e3a131 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/Resources/zh-Hans.json @@ -107,6 +107,7 @@ "Data:Items": "字典项目", "DuplicateData": "已经存在名为 {0} 的数据字典!", "DuplicateDataItem": "已经存在名为 {0} 的数据字典项!", + "DataNotFound": "不存在名为 {0} 的数据字典!", "DataItemNotFound": "不存在名为 {0} 的数据字典项!", "UnableRemoveHasChildNode": "当前数据字典存在子节点,无法删除!", "DuplicateLayout": "已经存在名为 {0} 的布局!", diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuEto.cs index d27e975a0..7cf1ad8c1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuEto.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Platform.Menus; [EventName("platform.menus.menu")] public class MenuEto : RouteEto { - public string Framework { get; set; } + public string Framework { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/RoleMenuEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/RoleMenuEto.cs index 85d5a4c8d..49db8efbb 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/RoleMenuEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/RoleMenuEto.cs @@ -9,5 +9,5 @@ public class RoleMenuEto : IMultiTenant { public Guid? TenantId { get; set; } public Guid MenuId { get; set; } - public string RoleName { get; set; } + public string RoleName { get; set; } = default!; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Messages/EmailMessageEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Messages/EmailMessageEto.cs index dffb3aaa9..6ead79aee 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Messages/EmailMessageEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Messages/EmailMessageEto.cs @@ -5,6 +5,6 @@ namespace LINGYUN.Platform.Messages; [EventName("platform.messages.email")] public class EmailMessageEto : MessageEto { - public string From { get; set; } - public string Subject { get; set; } + public string? From { get; set; } + public string? Subject { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Messages/MessageEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Messages/MessageEto.cs index 491037d08..67a99dad6 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Messages/MessageEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Messages/MessageEto.cs @@ -5,7 +5,7 @@ public abstract class MessageEto { public Guid Id { get; set; } public Guid? UserId { get; set; } - public string Sender { get; set; } + public string? Sender { get; set; } public DateTime CreationTime { get; set; } public Guid? CreatorId { get; set; } public MessageStatus Status { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Packages/PackageEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Packages/PackageEto.cs index 47a513564..cf8abeaaf 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Packages/PackageEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Packages/PackageEto.cs @@ -10,11 +10,11 @@ public class PackageEto /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 版本 /// - public string Version { get; set; } + public string Version { get; set; } = default!; /// /// 强制更新 /// diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteEto.cs index 1e9806ba6..af8b56799 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteEto.cs @@ -7,9 +7,9 @@ public abstract class RouteEto : IMultiTenant { public Guid? TenantId { get; set; } public Guid Id { get; set; } - public string Path { get; set; } - public string Name { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } - public string Redirect { get; set; } + public string Path { get; set; } = default!; + public string Name { get; set; } = default!; + public string DisplayName { get; set; } = default!; + public string? Description { get; set; } + public string? Redirect { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/Data.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/Data.cs index 2f1dbebc1..8dae4dd91 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/Data.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/Data.cs @@ -17,13 +17,13 @@ public class Data : FullAuditedAggregateRoot, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - public virtual string Name { get; set; } + public virtual string Name { get; set; } = default!; - public virtual string Code { get; set; } + public virtual string Code { get; set; } = default!; - public virtual string DisplayName { get; set; } + public virtual string DisplayName { get; set; } = default!; - public virtual string Description { get; set; } + public virtual string? Description { get; set; } public virtual Guid? ParentId { get; set; } @@ -41,7 +41,7 @@ public class Data : FullAuditedAggregateRoot, IMultiTenant [NotNull] string name, [NotNull] string code, [NotNull] string displayName, - string description = "", + string? description = null, Guid? parentId = null, Guid? tenantId = null) { @@ -67,9 +67,9 @@ public class Data : FullAuditedAggregateRoot, IMultiTenant [NotNull] IGuidGenerator guidGenerator, [NotNull] string name, [NotNull] string displayName, - [CanBeNull] string defaultValue, + [CanBeNull] string? defaultValue, ValueType valueType = ValueType.String, - string description = "", + string? description = null, bool allowBeNull = true, bool isStatic = false) { @@ -99,12 +99,12 @@ public class Data : FullAuditedAggregateRoot, IMultiTenant return this; } - public DataItem FindItem(string name) + public DataItem? FindItem(string name) { return Items.FirstOrDefault(item => item.Name == name); } - public DataItem FindItem(Guid id) + public DataItem? FindItem(Guid id) { return Items.FirstOrDefault(item => item.Id == id); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataDictionaryDataSeeder.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataDictionaryDataSeeder.cs index 249269b57..6548db7e2 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataDictionaryDataSeeder.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataDictionaryDataSeeder.cs @@ -28,7 +28,7 @@ public class DataDictionaryDataSeeder : IDataDictionaryDataSeeder, ITransientDep string name, string code, string displayName, - string description = "", + string? description = null, Guid? parentId = null, Guid? tenantId = null, bool isStatic = false, diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItem.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItem.cs index e7ae03ca6..740a6d99a 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItem.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItem.cs @@ -10,13 +10,13 @@ public class DataItem : FullAuditedAggregateRoot, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; - public virtual string DisplayName { get; set; } + public virtual string DisplayName { get; set; } = default!; - public virtual string DefaultValue { get; set; } + public virtual string? DefaultValue { get; set; } - public virtual string Description { get; set; } + public virtual string? Description { get; set; } public virtual bool AllowBeNull { get; set; } @@ -33,9 +33,9 @@ public class DataItem : FullAuditedAggregateRoot, IMultiTenant [NotNull] Guid dataId, [NotNull] string name, [NotNull] string displayName, - [CanBeNull] string defaultValue = null, + [CanBeNull] string? defaultValue = null, ValueType valueType = ValueType.String, - string description = "", + string? description = null, bool allowBeNull = true, Guid? tenantId = null) { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItemMappingOptions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItemMappingOptions.cs index f592a0080..620183fe6 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItemMappingOptions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItemMappingOptions.cs @@ -40,7 +40,7 @@ public class DataItemMappingOptions var joinString = string.Empty; foreach (var node in jsonArray) { - joinString += node.ToString() + ","; + joinString += node!.ToString() + ","; } return joinString.EndsWith(",") ? joinString[..^1] : joinString; } @@ -66,7 +66,7 @@ public class DataItemMappingOptions } else { - var boInput = value.ToString().ToLower(); + var boInput = value.ToString()!.ToLower(); if (boInput == "true" || boInput == "false") { @@ -99,7 +99,7 @@ public class DataItemMappingOptions var valueType = value.GetType(); if (!valueType.IsClass && !valueType.IsInterface && typeof(IFormattable).IsAssignableFrom(valueType)) { - return value.ToString(); + return value.ToString()!; } } throw new BusinessException(PlatformErrorCodes.MetaFormatMissMatch); @@ -110,7 +110,7 @@ public class DataItemMappingOptions { return ""; } - return value.ToString(); + return value.ToString()!; }); SetMapping(ValueType.Object, value => { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataDictionaryDataSeeder.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataDictionaryDataSeeder.cs index a62a175f2..fb6a9c6ac 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataDictionaryDataSeeder.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataDictionaryDataSeeder.cs @@ -10,7 +10,7 @@ public interface IDataDictionaryDataSeeder string name, string code, string displayName, - string description = "", + string? description = null, Guid? parentId = null, Guid? tenantId = null, bool isStatic = false, diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataRepository.cs index 742ca3e8a..bb8abfec9 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataRepository.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Platform.Datas; public interface IDataRepository : IBasicRepository { - Task FindByNameAsync( + Task FindByNameAsync( string name, bool includeDetails = true, CancellationToken cancellationToken = default); @@ -20,12 +20,12 @@ public interface IDataRepository : IBasicRepository ); Task GetCountAsync( - string filter = "", + string? filter = null, CancellationToken cancellationToken = default); Task> GetPagedListAsync( - string filter = "", - string sorting = nameof(Data.Code), + string? filter = null, + string? sorting = nameof(Data.Code), bool includeDetails = false, int skipCount = 0, int maxResultCount = 10, diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/Feedback.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/Feedback.cs index 70893b1ae..eb58ae61b 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/Feedback.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/Feedback.cs @@ -12,8 +12,8 @@ namespace LINGYUN.Platform.Feedbacks; public class Feedback : FullAuditedAggregateRoot, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - public virtual string Content { get; set; } - public virtual string Category { get; protected set; } + public virtual string Content { get; set; } = default!; + public virtual string Category { get; protected set; } = default!; public virtual FeedbackStatus Status { get; protected set; } public virtual ICollection Comments { get; protected set; } public virtual ICollection Attachments { get; protected set; } @@ -71,7 +71,7 @@ public class Feedback : FullAuditedAggregateRoot, IMultiTenant return attachment; } - public FeedbackAttachment FindAttachment(string name) + public FeedbackAttachment? FindAttachment(string name) { return Attachments.FirstOrDefault(x => x.Name == name); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/FeedbackAttachment.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/FeedbackAttachment.cs index 2a244bcb1..7f4c174cb 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/FeedbackAttachment.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/FeedbackAttachment.cs @@ -7,8 +7,8 @@ namespace LINGYUN.Platform.Feedbacks; public class FeedbackAttachment : CreationAuditedEntity, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - public virtual string Name { get; protected set; } - public virtual string Url { get; protected set; } + public virtual string Name { get; protected set; } = default!; + public virtual string Url { get; protected set; } = default!; public virtual long Size { get; protected set; } public virtual Guid FeedbackId { get; protected set; } protected FeedbackAttachment() diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/FeedbackComment.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/FeedbackComment.cs index a53e42b72..149e74568 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/FeedbackComment.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/FeedbackComment.cs @@ -10,8 +10,8 @@ namespace LINGYUN.Platform.Feedbacks; public class FeedbackComment : AuditedEntity, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - public virtual string Capacity { get; protected set; } - public virtual string Content { get; set; } + public virtual string Capacity { get; protected set; } = default!; + public virtual string Content { get; set; } = default!; public virtual Guid FeedbackId { get; protected set; } protected FeedbackComment() { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/IFeedbackRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/IFeedbackRepository.cs index 8646a960f..7934e0af9 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/IFeedbackRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Feedbacks/IFeedbackRepository.cs @@ -14,7 +14,7 @@ public interface IFeedbackRepository : IBasicRepository Task> GetListAsync( ISpecification specification, - string sorting = $"{nameof(Feedback.CreationTime)} DESC", + string? sorting = $"{nameof(Feedback.CreationTime)} DESC", int maxResultCount = 25, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs index 792e911f0..37cad5d87 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs @@ -15,20 +15,20 @@ public interface ILayoutRepository : IBasicRepository /// /// /// - Task FindByNameAsync( + Task FindByNameAsync( string name, bool includeDetails = true, CancellationToken cancellationToken = default); Task GetCountAsync( - string framework = "", - string filter = "", + string? framework = null, + string? filter = null, CancellationToken cancellationToken = default); Task> GetPagedListAsync( - string framework = "", - string filter = "", - string sorting = nameof(Layout.Name), + string? framework = null, + string? filter = null, + string? sorting = nameof(Layout.Name), bool includeDetails = false, int skipCount = 0, int maxResultCount = 10, diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs index 78c7b9c4f..f591396d9 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs @@ -12,7 +12,7 @@ public class Layout : Route /// /// 框架 /// - public virtual string Framework { get; protected set; } + public virtual string Framework { get; protected set; } = default!; /// /// 约定的Meta采用哪种数据字典,主要是约束路由必须字段的一致性 /// @@ -27,8 +27,8 @@ public class Layout : Route [NotNull] string displayName, [NotNull] Guid dataId, [NotNull] string framework, - [CanBeNull] string redirect = "", - [CanBeNull] string description = "", + [CanBeNull] string? redirect = null, + [CanBeNull] string? description = null, [CanBeNull] Guid? tenantId = null) : base(id, path, name, displayName, redirect, description, tenantId) { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/DefaultStandardMenuConverter.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/DefaultStandardMenuConverter.cs index 4159e63c9..b26b3ef7e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/DefaultStandardMenuConverter.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/DefaultStandardMenuConverter.cs @@ -11,7 +11,7 @@ public class DefaultStandardMenuConverter : IStandardMenuConverter, ISingletonDe { Icon = "", Name = menu.Name, - Path = menu.Path, + Path = menu.Path!, DisplayName = menu.DisplayName, Description = menu.Description, Redirect = menu.Redirect, diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs index 6ec05ed9d..6467786b8 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs @@ -17,7 +17,7 @@ public interface IMenuRepository : IBasicRepository /// /// /// - Task GetLastMenuAsync( + Task FindLastMenuAsync( Guid? parentId = null, CancellationToken cancellationToken = default); /// @@ -26,7 +26,7 @@ public interface IMenuRepository : IBasicRepository /// /// /// - Task FindByNameAsync( + Task FindByNameAsync( string menuName, CancellationToken cancellationToken = default); /// @@ -35,8 +35,8 @@ public interface IMenuRepository : IBasicRepository /// /// /// - Task FindMainAsync( - string framework = "", + Task FindMainAsync( + string? framework = null, CancellationToken cancellationToken = default); /// /// 获取子节点 @@ -71,7 +71,7 @@ public interface IMenuRepository : IBasicRepository Task> GetUserMenusAsync( Guid userId, string[] roles, - string framework = "", + string? framework = null, CancellationToken cancellationToken = default); /// /// 查找角色可访问菜单 @@ -82,30 +82,30 @@ public interface IMenuRepository : IBasicRepository /// Task> GetRoleMenusAsync( string[] roles, - string framework = "", + string? framework = null, CancellationToken cancellationToken = default); Task GetCountAsync( - string filter = "", - string framework = "", + string? filter =null, + string? framework = null, Guid? parentId = null, Guid? layoutId = null, CancellationToken cancellationToken = default); Task> GetListAsync( - string filter = "", - string sorting = nameof(Menu.Code), - string framework = "", + string? filter = null, + string? framework = null, Guid? parentId = null, Guid? layoutId = null, + string? sorting = nameof(Menu.Code), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); Task> GetAllAsync( - string filter = "", - string sorting = nameof(Menu.Code), - string framework = "", + string? filter = null, + string? framework = null, + string? sorting = nameof(Menu.Code), Guid? parentId = null, Guid? layoutId = null, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IRoleMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IRoleMenuRepository.cs index 6beb9c1a4..318bf871a 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IRoleMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IRoleMenuRepository.cs @@ -22,11 +22,11 @@ public interface IRoleMenuRepository : IBasicRepository Task> GetListByRoleNameAsync( string roleName, - string framework = null, + string? framework = null, CancellationToken cancellationToken = default); - Task FindStartupMenuAsync( + Task FindStartupMenuAsync( IEnumerable roleNames, - string framework = null, + string? framework = null, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserFavoriteMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserFavoriteMenuRepository.cs index 31bf1d08f..502e32f53 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserFavoriteMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserFavoriteMenuRepository.cs @@ -14,7 +14,7 @@ public interface IUserFavoriteMenuRepository : IBasicRepository FindByUserMenuAsync( + Task FindByUserMenuAsync( Guid userId, Guid menuId, CancellationToken cancellationToken = default); @@ -25,7 +25,7 @@ public interface IUserFavoriteMenuRepository : IBasicRepository> GetFavoriteMenusAsync( Guid userId, - string framework = null, + string? framework = null, Guid? menuId = null, - CancellationToken cancellationToken = default); + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserMenuRepository.cs index 90fe60826..1aa1c8df9 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserMenuRepository.cs @@ -22,11 +22,11 @@ public interface IUserMenuRepository : IBasicRepository Task> GetListByUserIdAsync( Guid userId, - string framework = null, + string? framework = null, CancellationToken cancellationToken = default); - Task FindStartupMenuAsync( + Task FindStartupMenuAsync( Guid userId, - string framework = null, + string? framework = null, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/Menu.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/Menu.cs index 6707915cc..aaa272204 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/Menu.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/Menu.cs @@ -13,15 +13,15 @@ public class Menu : Route /// /// 框架 /// - public virtual string Framework { get; set; } + public virtual string Framework { get; set; } = default!; /// /// 菜单编号 /// - public virtual string Code { get; set; } + public virtual string Code { get; set; } = default!; /// /// 菜单布局页,Layout的路径 /// - public virtual string Component { get; set; } + public virtual string Component { get; set; } = default!; /// /// 所属的父菜单 /// @@ -47,8 +47,8 @@ public class Menu : Route [NotNull] string component, [NotNull] string displayName, [NotNull] string framework, - string redirect = "", - string description = "", + string? redirect = null, + string? description = null, Guid? parentId = null, Guid? tenantId = null) : base(id, path, name, displayName, redirect, description, tenantId) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/MenuManager.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/MenuManager.cs index 0772e163e..144636b95 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/MenuManager.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/MenuManager.cs @@ -36,8 +36,8 @@ public class MenuManager : DomainService string name, string component, string displayName, - string redirect = "", - string description = "", + string? redirect = null, + string? description = null, Guid? parentId = null, Guid? tenantId = null, bool isPublic = false) @@ -116,7 +116,7 @@ public class MenuManager : DomainService foreach (var child in children) { - child.Code = CodeNumberGenerator.AppendCode(menu.Code, CodeNumberGenerator.GetRelativeCode(child.Code, oldCode)); + child.Code = CodeNumberGenerator.AppendCode(menu.Code, CodeNumberGenerator.GetRelativeCode(child.Code, oldCode)!); } } @@ -126,7 +126,7 @@ public class MenuManager : DomainService return false; } - public async virtual Task SetUserStartupMenuAsync(Guid userId, Guid? menuId = null, string framework = null) + public async virtual Task SetUserStartupMenuAsync(Guid userId, Guid? menuId = null, string? framework = null) { using (var unitOfWork = UnitOfWorkManager.Begin()) { @@ -147,7 +147,7 @@ public class MenuManager : DomainService } } - public async virtual Task SetUserMenusAsync(Guid userId, IEnumerable menuIds, string framework = null) + public async virtual Task SetUserMenusAsync(Guid userId, IEnumerable menuIds, string? framework = null) { using (var unitOfWork = UnitOfWorkManager.Begin()) { @@ -173,7 +173,7 @@ public class MenuManager : DomainService } } - public async virtual Task SetRoleStartupMenuAsync(string roleName, Guid? menuId = null, string framework = null) + public async virtual Task SetRoleStartupMenuAsync(string roleName, Guid? menuId = null, string? framework = null) { using (var unitOfWork = UnitOfWorkManager.Begin()) { @@ -194,7 +194,7 @@ public class MenuManager : DomainService } } - public async virtual Task SetRoleMenusAsync(string roleName, IEnumerable menuIds, string framework = null) + public async virtual Task SetRoleMenusAsync(string roleName, IEnumerable menuIds, string? framework = null) { using (var unitOfWork = UnitOfWorkManager.Begin()) { @@ -238,7 +238,7 @@ public class MenuManager : DomainService ); } - public async virtual Task GetLastChildOrNullAsync(Guid? parentId) + public async virtual Task GetLastChildOrNullAsync(Guid? parentId) { var children = await MenuRepository.GetChildrenAsync(parentId); return children.OrderBy(c => c.Code).LastOrDefault(); @@ -258,10 +258,10 @@ public class MenuManager : DomainService var code = await GetCodeOrDefaultAsync(parentId.Value); - return await MenuRepository.GetAllChildrenWithParentCodeAsync(code, parentId); + return await MenuRepository.GetAllChildrenWithParentCodeAsync(code!, parentId); } - public async virtual Task GetCodeOrDefaultAsync(Guid id) + public async virtual Task GetCodeOrDefaultAsync(Guid id) { var menu = await MenuRepository.GetAsync(id); return menu?.Code; diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/RoleMenu.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/RoleMenu.cs index 09a4c1582..77d691de2 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/RoleMenu.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/RoleMenu.cs @@ -13,7 +13,7 @@ public class RoleMenu : AuditedEntity, IMultiTenant public virtual Guid MenuId { get; protected set; } - public virtual string RoleName { get; protected set; } + public virtual string RoleName { get; protected set; } = default!; public virtual bool Startup { get; set; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/StandardMenu.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/StandardMenu.cs index f71227dc1..a40df21e5 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/StandardMenu.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/StandardMenu.cs @@ -1,10 +1,10 @@ namespace LINGYUN.Platform.Menus; public class StandardMenu { - public string Icon { get; set; } - public string Path { get; set; } - public string Name { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } - public string Redirect { get; set; } + public string? Icon { get; set; } + public string Path { get; set; } = default!; + public string Name { get; set; } = default!; + public string DisplayName { get; set; } = default!; + public string? Description { get; set; } + public string? Redirect { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/UserFavoriteMenu.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/UserFavoriteMenu.cs index 046345e8a..1427d1be6 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/UserFavoriteMenu.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/UserFavoriteMenu.cs @@ -14,19 +14,19 @@ public class UserFavoriteMenu : AuditedEntity, IMultiTenant public virtual Guid UserId { get; protected set; } - public virtual string AliasName { get; set; } + public virtual string? AliasName { get; set; } - public virtual string Color { get; set; } + public virtual string? Color { get; set; } - public virtual string Framework { get; set; } + public virtual string Framework { get; set; } = default!; - public virtual string Name { get; set; } + public virtual string Name { get; set; } = default!; - public virtual string DisplayName { get; set; } + public virtual string DisplayName { get; set; } = default!; - public virtual string Path { get; set; } + public virtual string Path { get; set; } = default!; - public virtual string Icon { get; set; } + public virtual string? Icon { get; set; } protected UserFavoriteMenu() { } public UserFavoriteMenu( @@ -37,9 +37,9 @@ public class UserFavoriteMenu : AuditedEntity, IMultiTenant string name, string displayName, string path, - string icon, - string color, - string aliasName = null, + string? icon = null, + string? color = null, + string? aliasName = null, Guid? tenantId = null) : base(id) { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessage.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessage.cs index da51feab5..87b97c358 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessage.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessage.cs @@ -9,10 +9,10 @@ using Volo.Abp; namespace LINGYUN.Platform.Messages; public class EmailMessage : Message { - public virtual string From { get; set; } - public virtual string Subject { get; private set; } + public virtual string? From { get; set; } + public virtual string? Subject { get; private set; } public virtual bool IsBodyHtml { get; private set; } - public virtual string CC { get; private set; } + public virtual string? CC { get; private set; } public virtual bool Normalize { get; set; } public virtual MailPriority? Priority { get; set; } public virtual TransferEncoding? BodyTransferEncoding { get; set; } @@ -27,13 +27,13 @@ public class EmailMessage : Message public EmailMessage( Guid id, string to, - string from, - string subject, + string? from, + string? subject, string body, bool isBodyHtml = false, - string cc = null, + string? cc = null, Guid? userId = null, - string userName = null) + string ?userName = null) : base(id, to, body, userId, userName) { From = Check.Length(from, nameof(from), EmailMessageConsts.MaxFromLength); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageAttachment.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageAttachment.cs index d2e5f3dd2..c9ffe4849 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageAttachment.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageAttachment.cs @@ -6,8 +6,8 @@ namespace LINGYUN.Platform.Messages; public class EmailMessageAttachment : Entity { public virtual Guid MessageId { get; private set; } - public virtual string Name { get; private set; } - public virtual string BlobName { get; private set; } + public virtual string Name { get; private set; } = default!; + public virtual string BlobName { get; private set; } = default!; public virtual long Size { get; private set; } protected EmailMessageAttachment() { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageHeader.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageHeader.cs index 6a8c578cf..3a0d7a7a1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageHeader.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageHeader.cs @@ -6,8 +6,8 @@ namespace LINGYUN.Platform.Messages; public class EmailMessageHeader : Entity { public virtual Guid MessageId { get; private set; } - public virtual string Key { get; private set; } - public virtual string Value { get; private set; } + public virtual string Key { get; private set; } = default!; + public virtual string Value { get; private set; } = default!; protected EmailMessageHeader() { } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageManager.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageManager.cs index b7b546420..f1998234c 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageManager.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/EmailMessageManager.cs @@ -49,14 +49,14 @@ public class EmailMessageManager : DomainService, IEmailMessageManager return message; } - public async virtual Task TrySendAsync(IEmailSender emailSender, EmailMessage message) + public async virtual Task TrySendAsync(IEmailSender emailSender, EmailMessage message) { try { MailAddress from; if (message.From.IsNullOrWhiteSpace()) { - var defaultFrom = await SettingProvider.GetOrNullAsync(EmailSettingNames.DefaultFromAddress); + var defaultFrom = await SettingProvider.GetOrNullAsync(EmailSettingNames.DefaultFromAddress) ?? "noreply@abp.io"; var defaultFromDisplayName = await SettingProvider.GetOrNullAsync(EmailSettingNames.DefaultFromDisplayName); from = new MailAddress(defaultFrom, defaultFromDisplayName); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/IEmailMessageRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/IEmailMessageRepository.cs index 484abc8ab..57619aa43 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/IEmailMessageRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/IEmailMessageRepository.cs @@ -14,7 +14,7 @@ public interface IEmailMessageRepository : IBasicRepository Task> GetListAsync( ISpecification specification, - string sorting = $"{nameof(Message.CreationTime)} DESC", + string? sorting = $"{nameof(Message.CreationTime)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/ISmsMessageRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/ISmsMessageRepository.cs index 4ccef2bd9..e65dd9c25 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/ISmsMessageRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/ISmsMessageRepository.cs @@ -14,7 +14,7 @@ public interface ISmsMessageRepository : IBasicRepository Task> GetListAsync( ISpecification specification, - string sorting = $"{nameof(Message.CreationTime)} DESC", + string? sorting = $"{nameof(Message.CreationTime)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/Message.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/Message.cs index fec5e3b0e..fd2626ba2 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/Message.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/Message.cs @@ -8,14 +8,14 @@ namespace LINGYUN.Platform.Messages; public class Message : AuditedAggregateRoot { public virtual Guid? UserId { get; private set; } - public virtual string Sender { get; private set; } - public virtual string Provider { get; set; } - public virtual string Receiver { get; private set; } - public virtual string Content { get; private set; } + public virtual string? Sender { get; private set; } + public virtual string? Provider { get; set; } + public virtual string Receiver { get; private set; } = default!; + public virtual string Content { get; private set; } = default!; public virtual DateTime? SendTime { get; private set; } public virtual int SendCount { get; private set; } public virtual MessageStatus Status { get; private set; } - public virtual string Reason { get; private set; } + public virtual string? Reason { get; private set; } protected Message() { @@ -25,13 +25,13 @@ public class Message : AuditedAggregateRoot public Message( Guid id, string receiver, - string content, + string? content, Guid? userId = null, - string userName = null) + string? userName = null) : base(id) { Receiver = Check.NotNullOrWhiteSpace(receiver, nameof(receiver), MessageConsts.MaxReceiverLength); - Content = content; + Content = content ?? ""; UserId = userId; Sender = Check.Length(userName, nameof(userName), MessageConsts.MaxSenderLength); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/SmsMessage.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/SmsMessage.cs index 9ac80d692..37dd278c3 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/SmsMessage.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/SmsMessage.cs @@ -11,7 +11,7 @@ public class SmsMessage : Message string phoneNumber, string content, Guid? userId = null, - string userName = null) + string? userName = null) : base(id, phoneNumber, content, userId, userName) { } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/SmsMessageManager.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/SmsMessageManager.cs index b3ba72ce9..ec555f3d8 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/SmsMessageManager.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Messages/SmsMessageManager.cs @@ -34,7 +34,7 @@ public class SmsMessageManager : DomainService, ISmsMessageManager return message; } - public async virtual Task TrySendAsync(ISmsSender smsSender, SmsMessage message) + public async virtual Task TrySendAsync(ISmsSender smsSender, SmsMessage message) { try { @@ -44,7 +44,7 @@ public class SmsMessageManager : DomainService, ISmsMessageManager foreach (var prop in message.ExtraProperties) { - smsMessage.Properties.Add(prop.Key, prop.Value); + smsMessage.Properties.Add(prop.Key, prop.Value ?? ""); } await smsSender.SendAsync(smsMessage); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/IPackageRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/IPackageRepository.cs index 5b4a00aa1..fbe53f006 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/IPackageRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/IPackageRepository.cs @@ -9,14 +9,14 @@ namespace LINGYUN.Platform.Packages; public interface IPackageRepository : IBasicRepository { - Task FindByNameAsync( + Task FindByNameAsync( string name, bool includeDetails = true, CancellationToken cancellationToken = default); - Task FindLatestAsync( + Task FindLatestAsync( string name, - string version = null, + string? version = null, bool includeDetails = true, CancellationToken cancellationToken = default); @@ -26,7 +26,7 @@ public interface IPackageRepository : IBasicRepository Task> GetListAsync( Specification specification, - string sorting = $"{nameof(Package.Version)} DESC", + string? sorting = $"{nameof(Package.Version)} DESC", int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/Package.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/Package.cs index ab4dbad5e..898f96f97 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/Package.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/Package.cs @@ -15,25 +15,25 @@ public class Package : FullAuditedAggregateRoot /// /// 名称 /// - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; /// /// 版本说明 /// - public virtual string Note { get; protected set; } + public virtual string Note { get; protected set; } = default!; /// /// 版本 /// - public virtual string Version { get; protected set; } + public virtual string Version { get; protected set; } = default!; /// /// 描述 /// - public virtual string Description { get; set; } + public virtual string? Description { get; set; } /// /// 强制更新 /// public virtual bool ForceUpdate { get; set; } - public virtual string Authors { get; set; } + public virtual string? Authors { get; set; } public virtual PackageLevel Level { get; set; } @@ -51,7 +51,7 @@ public class Package : FullAuditedAggregateRoot string name, string note, string version, - string description = null) + string? description = null) : base(id) { Name = Check.NotNullOrWhiteSpace(name, nameof(name), PackageConsts.MaxNameLength); @@ -76,7 +76,7 @@ public class Package : FullAuditedAggregateRoot DateTime createdAt, DateTime? updatedAt = null, long? size = null, - string summary = null) + string? summary = null) { var findBlob = FindBlob(name); if (findBlob == null) @@ -93,7 +93,7 @@ public class Package : FullAuditedAggregateRoot return findBlob; } - public PackageBlob FindBlob(string name) + public PackageBlob? FindBlob(string name) { return Blobs.FirstOrDefault(x => x.Name == name); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageBlob.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageBlob.cs index c791981a8..07b879f65 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageBlob.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageBlob.cs @@ -9,17 +9,17 @@ namespace LINGYUN.Platform.Packages; public class PackageBlob : CreationAuditedEntity, IHasExtraProperties { public virtual Guid PackageId { get; private set; } - public virtual Package Package { get; private set; } - public virtual string Name { get; protected set; } - public virtual string Url { get; protected set; } + public virtual Package Package { get; private set; } = default!; + public virtual string Name { get; protected set; } = default!; + public virtual string? Url { get; protected set; } public virtual long? Size { get; protected set; } - public virtual string Summary { get; protected set; } + public virtual string? Summary { get; protected set; } public virtual DateTime CreatedAt { get; protected set; } public virtual DateTime? UpdatedAt { get; protected set; } - public virtual string License { get; set; } - public virtual string Authors { get; set; } - public virtual string ContentType { get; set; } - public virtual string SHA256 { get; set; } + public virtual string? License { get; set; } + public virtual string? Authors { get; set; } + public virtual string? ContentType { get; set; } + public virtual string? SHA256 { get; set; } public virtual int DownloadCount { get; protected set; } public virtual ExtraPropertyDictionary ExtraProperties { get; set; } @@ -35,7 +35,7 @@ public class PackageBlob : CreationAuditedEntity, IHasExtraProperties DateTime createdAt, DateTime? updatedAt = null, long? size = null, - string summary = null) + string? summary = null) { PackageId = packageId; Name = Check.NotNullOrWhiteSpace(name, nameof(name), PackageBlobConsts.MaxNameLength); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageFilter.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageFilter.cs index fd05d0678..7261ca19f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageFilter.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageFilter.cs @@ -2,28 +2,28 @@ public class PackageFilter { - public string Filter { get; set; } + public string? Filter { get; set; } - public string Name { get; set; } + public string? Name { get; set; } - public string Note { get; set; } + public string? Note { get; set; } - public string Version { get; set; } + public string? Version { get; set; } - public string Description { get; set; } + public string? Description { get; set; } public bool? ForceUpdate { get; set; } - public string Authors { get; set; } + public string? Authors { get; set; } public PackageFilter( - string filter = null, - string name = null, - string note = null, - string version = null, - string description = null, + string? filter = null, + string? name = null, + string? note = null, + string? version = null, + string? description = null, bool? forceUpdate = null, - string authors = null) + string? authors = null) { Filter = filter; Name = name; diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageSpecification.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageSpecification.cs index 30acae3a3..0e1815044 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageSpecification.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageSpecification.cs @@ -24,8 +24,8 @@ public class PackageSpecification : Specification .AndIf(!Filter.Description.IsNullOrWhiteSpace(), x => x.Description == Filter.Description) .AndIf(!Filter.Authors.IsNullOrWhiteSpace(), x => x.Authors == Filter.Authors) .AndIf(Filter.ForceUpdate.HasValue, x => x.ForceUpdate == Filter.ForceUpdate) - .AndIf(!Filter.Filter.IsNullOrWhiteSpace(), x => x.Name.Contains(Filter.Filter) || - x.Note.Contains(Filter.Filter) || x.Version.Contains(Filter.Filter) || - x.Description.Contains(Filter.Filter) || x.Authors.Contains(Filter.Filter)); + .AndIf(!Filter.Filter.IsNullOrWhiteSpace(), x => x.Name.Contains(Filter.Filter!) || + x.Note.Contains(Filter.Filter!) || x.Version.Contains(Filter.Filter!) || + x.Description!.Contains(Filter.Filter!) || x.Authors!.Contains(Filter.Filter!)); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDbProperties.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDbProperties.cs index d1ed86ce9..e60b9b3a2 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDbProperties.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDbProperties.cs @@ -4,7 +4,7 @@ public static class PlatformDbProperties { public static string DbTablePrefix { get; set; } = "AppPlatform"; - public static string DbSchema { get; set; } = null; + public static string? DbSchema { get; set; } = null; public const string ConnectionStringName = "AppPlatform"; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/Enterprise.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/Enterprise.cs index 57be08633..330a9aac1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/Enterprise.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/Enterprise.cs @@ -16,35 +16,35 @@ public class Enterprise : FullAuditedAggregateRoot /// /// 名称 /// - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; /// /// 英文名称 /// - public virtual string EnglishName { get; set; } + public virtual string? EnglishName { get; set; } /// /// Logo /// - public virtual string Logo { get; set; } + public virtual string? Logo { get; set; } /// /// 地址 /// - public virtual string Address { get; set; } + public virtual string? Address { get; set; } /// /// 法人代表 /// - public virtual string LegalMan { get; set; } + public virtual string? LegalMan { get; set; } /// /// 税务登记号 /// - public virtual string TaxCode { get; set; } + public virtual string? TaxCode { get; set; } /// /// 组织机构代码 /// - public virtual string OrganizationCode { get; protected set; } + public virtual string? OrganizationCode { get; protected set; } /// /// 注册代码 /// - public virtual string RegistrationCode { get; protected set; } + public virtual string? RegistrationCode { get; protected set; } /// /// 注册日期 /// @@ -62,10 +62,10 @@ public class Enterprise : FullAuditedAggregateRoot public Enterprise( Guid id, string name, - string address, - string taxCode, - string organizationCode = null, - string registrationCode = null, + string? address = null, + string? taxCode = null, + string? organizationCode = null, + string? registrationCode = null, DateTime? registrationDate = null, DateTime? expirationDate = null, Guid? tenantId = null) @@ -88,19 +88,19 @@ public class Enterprise : FullAuditedAggregateRoot TenantId = tenantId; } - public void SetName(string name, string englishName = null) + public void SetName(string name, string? englishName = null) { Name = Check.NotNullOrWhiteSpace(name, nameof(name), EnterpriseConsts.MaxNameLength); EnglishName = Check.Length(englishName, nameof(englishName), EnterpriseConsts.MaxEnglishNameLength); } - public void SetOrganization(string organizationCode) + public void SetOrganization(string? organizationCode) { OrganizationCode = Check.Length(organizationCode, nameof(organizationCode), EnterpriseConsts.MaxOrganizationCodeLength); } public void SetRegistration( - string registrationCode, + string? registrationCode, DateTime? registrationDate = null, DateTime? expirationDate = null) { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/IEnterpriseRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/IEnterpriseRepository.cs index 4a5a6b583..8a5fa5dad 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/IEnterpriseRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/IEnterpriseRepository.cs @@ -7,7 +7,7 @@ using Volo.Abp.Domain.Repositories; namespace LINGYUN.Platform.Portal; public interface IEnterpriseRepository : IRepository { - Task FindByNameAsync( + Task FindByNameAsync( string name, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs index 9b7a0155a..9a179c4ac 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs @@ -15,8 +15,8 @@ public interface IRouteDataSeeder string displayName, Guid dataId, string framework, - string redirect = "", - string description = "", + string? redirect = null, + string? description = null, Guid? tenantId = null, CancellationToken cancellationToken = default); @@ -27,12 +27,12 @@ public interface IRouteDataSeeder string code, string component, string displayName, - string redirect = "", - string description = "", + string? redirect = null, + string? description = null, Guid? parentId = null, Guid? tenantId = null, bool isPublic = false, - IDictionary meta = null, + IDictionary? meta = null, CancellationToken cancellationToken = default); Task SeedUserMenuAsync( diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs index daa2afcb1..0b82e77a2 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs @@ -18,23 +18,23 @@ public abstract class Route : FullAuditedAggregateRoot, IMultiTenant /// /// 路径 /// - public virtual string Path { get; set; } + public virtual string? Path { get; set; } /// /// 名称 /// - public virtual string Name { get; set; } + public virtual string Name { get; set; } = default!; /// /// 显示名称 /// - public virtual string DisplayName { get; set; } + public virtual string DisplayName { get; set; } = default!; /// /// 说明 /// - public virtual string Description { get; set; } + public virtual string? Description { get; set; } /// /// 重定向路径 /// - public virtual string Redirect { get; set; } + public virtual string? Redirect { get; set; } protected Route() { } @@ -43,8 +43,8 @@ public abstract class Route : FullAuditedAggregateRoot, IMultiTenant [NotNull] string path, [NotNull] string name, [NotNull] string displayName, - [CanBeNull] string redirect = "", - [CanBeNull] string description = "", + [CanBeNull] string? redirect = null, + [CanBeNull] string? description = null, [CanBeNull] Guid? tenantId = null) : base(id) { @@ -91,7 +91,7 @@ public abstract class Route : FullAuditedAggregateRoot, IMultiTenant return Name.GetHashCode(); } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj == null) { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs index 95657f6e9..7088136db 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs @@ -38,9 +38,9 @@ public class RouteDataSeeder : IRouteDataSeeder, ITransientDependency string path, string displayName, Guid dataId, - string framework, - string redirect = "", - string description = "", + string framework, + string? redirect = null, + string? description = null, Guid? tenantId = null, CancellationToken cancellationToken = default) { @@ -69,12 +69,12 @@ public class RouteDataSeeder : IRouteDataSeeder, ITransientDependency string code, string component, string displayName, - string redirect = "", - string description = "", + string? redirect = null, + string? description = null, Guid? parentId = null, Guid? tenantId = null, bool isPublic = false, - IDictionary meta = null, + IDictionary? meta = null, CancellationToken cancellationToken = default) { if (parentId.HasValue) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Utils/CodeNumberGenerator.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Utils/CodeNumberGenerator.cs index b8868ba96..2a75cec50 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Utils/CodeNumberGenerator.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Utils/CodeNumberGenerator.cs @@ -10,13 +10,13 @@ public static class CodeNumberGenerator { if (numbers.IsNullOrEmpty()) { - return null; + throw new ArgumentNullException(nameof(numbers), "numbers can not be null or empty."); } return numbers.Select(number => number.ToString(new string(PlatformConsts.CodePrefix, PlatformConsts.CodeUnitLength))).JoinAsString("."); } - public static string AppendCode(string parentCode, string childCode) + public static string AppendCode(string? parentCode, string childCode) { if (childCode.IsNullOrEmpty()) { @@ -31,7 +31,7 @@ public static class CodeNumberGenerator return parentCode + "." + childCode; } - public static string GetRelativeCode(string code, string parentCode) + public static string? GetRelativeCode(string code, string? parentCode) { if (code.IsNullOrEmpty()) { @@ -51,7 +51,7 @@ public static class CodeNumberGenerator return code.Substring(parentCode.Length + 1); } - public static string CalculateNextCode(string code) + public static string CalculateNextCode(string? code) { if (code.IsNullOrEmpty()) { @@ -75,7 +75,7 @@ public static class CodeNumberGenerator return splittedCode[splittedCode.Length - 1]; } - public static string GetParentCode(string code) + public static string? GetParentCode(string code) { if (code.IsNullOrEmpty()) { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Datas/EfCoreDataRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Datas/EfCoreDataRepository.cs index cc66e8c9c..71b68a4b4 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Datas/EfCoreDataRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Datas/EfCoreDataRepository.cs @@ -18,7 +18,7 @@ public class EfCoreDataRepository : EfCoreRepository FindByNameAsync( + public async virtual Task FindByNameAsync( string name, bool includeDetails = true, CancellationToken cancellationToken = default) @@ -43,20 +43,20 @@ public class EfCoreDataRepository : EfCoreRepository GetCountAsync( - string filter = "", + string? filter = null, CancellationToken cancellationToken = default) { var dbSet = await GetDbSetAsync(); return await dbSet .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Code.Contains(filter) || x.Description.Contains(filter) || - x.DisplayName.Contains(filter) || x.Name.Contains(filter)) + x.Code.Contains(filter!) || x.Description!.Contains(filter!) || + x.DisplayName.Contains(filter!) || x.Name.Contains(filter!)) .CountAsync(GetCancellationToken(cancellationToken)); } public async virtual Task> GetPagedListAsync( - string filter = "", - string sorting = "Code", + string? filter = null, + string? sorting = nameof(Data.Code), bool includeDetails = false, int skipCount = 0, int maxResultCount = 10, @@ -71,8 +71,8 @@ public class EfCoreDataRepository : EfCoreRepository - x.Code.Contains(filter) || x.Description.Contains(filter) || - x.DisplayName.Contains(filter) || x.Name.Contains(filter)) + x.Code.Contains(filter!) || x.Description!.Contains(filter!) || + x.DisplayName.Contains(filter!) || x.Name.Contains(filter!)) .OrderBy(sorting) .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellationToken)); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs index aac0f75fc..05a8b44a9 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs @@ -19,7 +19,7 @@ public static class PlatformDbContextModelBuilderExtensions { public static void ConfigurePlatform( this ModelBuilder builder, - Action optionsAction = null) + Action? optionsAction = null) { Check.NotNull(builder, nameof(builder)); @@ -462,7 +462,7 @@ public static class PlatformDbContextModelBuilderExtensions public static OwnedNavigationBuilder ConfigureRoute( [NotNull] this OwnedNavigationBuilder builder, [CanBeNull] string tablePrefix = "", - [CanBeNull] string schema = null) + [CanBeNull] string? schema = null) where TEntity : class where TRoute : Route { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformModelBuilderConfigurationOptions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformModelBuilderConfigurationOptions.cs index 74cd0684c..6d72d498b 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformModelBuilderConfigurationOptions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformModelBuilderConfigurationOptions.cs @@ -7,7 +7,7 @@ public class PlatformModelBuilderConfigurationOptions : AbpModelBuilderConfigura { public PlatformModelBuilderConfigurationOptions( [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) + [CanBeNull] string? schema = null) : base( tablePrefix, schema) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Feedbacks/EfCoreFeedbackRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Feedbacks/EfCoreFeedbackRepository.cs index d8d328b01..d339ff495 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Feedbacks/EfCoreFeedbackRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Feedbacks/EfCoreFeedbackRepository.cs @@ -30,7 +30,7 @@ public class EfCoreFeedbackRepository : EfCoreRepository> GetListAsync( ISpecification specification, - string sorting = $"{nameof(Feedback.CreationTime)} DESC", + string? sorting = $"{nameof(Feedback.CreationTime)} DESC", int maxResultCount = 25, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs index 0a2379c2d..b8a87419c 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs @@ -18,7 +18,7 @@ public class EfCoreLayoutRepository : EfCoreRepository FindByNameAsync( + public async virtual Task FindByNameAsync( string name, bool includeDetails = false, CancellationToken cancellationToken = default) @@ -30,22 +30,22 @@ public class EfCoreLayoutRepository : EfCoreRepository GetCountAsync( - string framework = "", - string filter = "", + string? framework = null, + string? filter = null, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) .WhereIf(!framework.IsNullOrWhiteSpace(), x => x.Framework.Equals(framework)) .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Name.Contains(filter) || x.DisplayName.Contains(filter) || - x.Description.Contains(filter) || x.Redirect.Contains(filter)) + x.Name.Contains(filter!) || x.DisplayName.Contains(filter!) || + x.Description!.Contains(filter!) || x.Redirect!.Contains(filter!)) .CountAsync(GetCancellationToken(cancellationToken)); } public async virtual Task> GetPagedListAsync( - string framework = "", - string filter = "", - string sorting = nameof(Layout.Name), + string? framework = null, + string? filter = null, + string? sorting = nameof(Layout.Name), bool includeDetails = false, int skipCount = 0, int maxResultCount = 10, @@ -60,8 +60,8 @@ public class EfCoreLayoutRepository : EfCoreRepository x.Framework.Equals(framework)) .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Name.Contains(filter) || x.DisplayName.Contains(filter) || - x.Description.Contains(filter) || x.Redirect.Contains(filter)) + x.Name.Contains(filter!) || x.DisplayName.Contains(filter!) || + x.Description!.Contains(filter!) || x.Redirect!.Contains(filter!)) .OrderBy(sorting) .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellationToken)); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs index 950cf2bd0..68aa1c39e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs @@ -28,7 +28,7 @@ public class EfCoreMenuRepository : EfCoreRepository GetLastMenuAsync( + public async virtual Task FindLastMenuAsync( Guid? parentId = null, CancellationToken cancellationToken = default) { @@ -66,7 +66,7 @@ public class EfCoreMenuRepository : EfCoreRepository x.RoleName == roleName, GetCancellationToken(cancellationToken)); } - public async virtual Task FindByNameAsync( + public async virtual Task FindByNameAsync( string menuName, CancellationToken cancellationToken = default) { @@ -75,8 +75,8 @@ public class EfCoreMenuRepository : EfCoreRepository FindMainAsync( - string framework = "", + public async virtual Task FindMainAsync( + string? framework = null, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) @@ -86,7 +86,7 @@ public class EfCoreMenuRepository : EfCoreRepository> GetRoleMenusAsync( string[] roles, - string framework = "", + string? framework = null, CancellationToken cancellationToken = default) { var menuQuery = (await GetDbSetAsync()) @@ -107,7 +107,7 @@ public class EfCoreMenuRepository : EfCoreRepository> GetUserMenusAsync( Guid userId, string[] roles, - string framework = "", + string? framework = null, CancellationToken cancellationToken = default) { var menuQuery = (await GetDbSetAsync()) @@ -158,14 +158,14 @@ public class EfCoreMenuRepository : EfCoreRepository x.Code.StartsWith(code) && x.Id != parentId.Value) + .Where(x => x.Code.StartsWith(code) && x.Id != parentId) .ToListAsync(GetCancellationToken(cancellationToken)); } public async virtual Task> GetAllAsync( - string filter = "", - string sorting = nameof(Menu.Code), - string framework = "", + string? filter = null, + string? framework = null, + string? sorting = nameof(Menu.Code), Guid? parentId = null, Guid? layoutId = null, CancellationToken cancellationToken = default) @@ -180,16 +180,16 @@ public class EfCoreMenuRepository : EfCoreRepository x.LayoutId == layoutId) .WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework)) .WhereIf(!filter.IsNullOrWhiteSpace(), menu => - menu.Path.Contains(filter) || menu.Name.Contains(filter) || - menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) || - menu.Redirect.Contains(filter)) + menu.Path!.Contains(filter!) || menu.Name.Contains(filter!) || + menu.DisplayName.Contains(filter!) || menu.Description!.Contains(filter!) || + menu.Redirect!.Contains(filter!)) .OrderBy(sorting) .ToListAsync(GetCancellationToken(cancellationToken)); } public async virtual Task GetCountAsync( - string filter = "", - string framework = "", + string? filter = null, + string? framework = null, Guid? parentId = null, Guid? layoutId = null, CancellationToken cancellationToken = default) @@ -199,18 +199,18 @@ public class EfCoreMenuRepository : EfCoreRepository x.LayoutId == layoutId) .WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework)) .WhereIf(!filter.IsNullOrWhiteSpace(), menu => - menu.Path.Contains(filter) || menu.Name.Contains(filter) || - menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) || - menu.Redirect.Contains(filter)) + menu.Path!.Contains(filter!) || menu.Name.Contains(filter!) || + menu.DisplayName.Contains(filter!) || menu.Description!.Contains(filter!) || + menu.Redirect!.Contains(filter!)) .CountAsync(GetCancellationToken(cancellationToken)); } public async virtual Task> GetListAsync( - string filter = "", - string sorting = nameof(Menu.Code), - string framework = "", + string? filter = null, + string? framework = null, Guid? parentId = null, Guid? layoutId = null, + string? sorting = nameof(Menu.Code), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) @@ -225,9 +225,9 @@ public class EfCoreMenuRepository : EfCoreRepository x.LayoutId == layoutId) .WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework)) .WhereIf(!filter.IsNullOrWhiteSpace(), menu => - menu.Path.Contains(filter) || menu.Name.Contains(filter) || - menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) || - menu.Redirect.Contains(filter)) + menu.Path!.Contains(filter!) || menu.Name.Contains(filter!) || + menu.DisplayName.Contains(filter!) || menu.Description!.Contains(filter!) || + menu.Redirect!.Contains(filter!)) .OrderBy(sorting) .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellationToken)); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreRoleMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreRoleMenuRepository.cs index 38e5b6fe2..f7c2bf064 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreRoleMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreRoleMenuRepository.cs @@ -21,7 +21,7 @@ public class EfCoreRoleMenuRepository : EfCoreRepository> GetListByRoleNameAsync( string roleName, - string framework = null, + string? framework = null, CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(); @@ -62,9 +62,9 @@ public class EfCoreRoleMenuRepository : EfCoreRepository FindStartupMenuAsync( + public async virtual Task FindStartupMenuAsync( IEnumerable roleNames, - string framework = null, + string? framework = null, CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserFavoriteMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserFavoriteMenuRepository.cs index 0691d4956..c770b1356 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserFavoriteMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserFavoriteMenuRepository.cs @@ -30,7 +30,7 @@ public class EfCoreUserFavoriteMenuRepository : public async virtual Task> GetFavoriteMenusAsync( Guid userId, - string framework = null, + string? framework = null, Guid? menuId = null, CancellationToken cancellationToken = default) { @@ -54,7 +54,7 @@ public class EfCoreUserFavoriteMenuRepository : GetCancellationToken(cancellationToken)); } - public async virtual Task FindByUserMenuAsync( + public async virtual Task FindByUserMenuAsync( Guid userId, Guid menuId, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserMenuRepository.cs index 37a3dbd65..bdd892b3e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserMenuRepository.cs @@ -37,7 +37,7 @@ public class EfCoreUserMenuRepository : EfCoreRepository> GetListByUserIdAsync( Guid userId, - string framework = null, + string? framework = null, CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(); @@ -62,9 +62,9 @@ public class EfCoreUserMenuRepository : EfCoreRepository FindStartupMenuAsync( + public async virtual Task FindStartupMenuAsync( Guid userId, - string framework = null, + string? framework = null, CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Messages/EfCoreEmailMessageRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Messages/EfCoreEmailMessageRepository.cs index 73e78c572..9e38ced98 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Messages/EfCoreEmailMessageRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Messages/EfCoreEmailMessageRepository.cs @@ -28,7 +28,7 @@ public class EfCoreEmailMessageRepository : EfCoreRepository> GetListAsync( ISpecification specification, - string sorting = $"{nameof(Message.CreationTime)} DESC", + string? sorting = $"{nameof(Message.CreationTime)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Messages/EfCoreSmsMessageRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Messages/EfCoreSmsMessageRepository.cs index f4ef1db45..b3891cf0a 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Messages/EfCoreSmsMessageRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Messages/EfCoreSmsMessageRepository.cs @@ -28,7 +28,7 @@ public class EfCoreSmsMessageRepository : EfCoreRepository> GetListAsync( ISpecification specification, - string sorting = $"{nameof(Message.CreationTime)} DESC", + string? sorting = $"{nameof(Message.CreationTime)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Packages/EfCorePackageRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Packages/EfCorePackageRepository.cs index 98c2fe4a7..c66313d28 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Packages/EfCorePackageRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Packages/EfCorePackageRepository.cs @@ -21,7 +21,7 @@ public class EfCorePackageRepository : { } - public async virtual Task FindByNameAsync( + public async virtual Task FindByNameAsync( string name, bool includeDetails = true, CancellationToken cancellationToken = default) @@ -33,9 +33,9 @@ public class EfCorePackageRepository : .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } - public async virtual Task FindLatestAsync( + public async virtual Task FindLatestAsync( string name, - string version = null, + string? version = null, bool includeDetails = true, CancellationToken cancellationToken = default) { @@ -67,7 +67,7 @@ public class EfCorePackageRepository : public async virtual Task> GetListAsync( Specification specification, - string sorting = $"{nameof(Package.Version)} DESC", + string? sorting = $"{nameof(Package.Version)} DESC", int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Portal/EfCoreEnterpriseRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Portal/EfCoreEnterpriseRepository.cs index abf2ff9cc..d80dba4a1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Portal/EfCoreEnterpriseRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Portal/EfCoreEnterpriseRepository.cs @@ -17,7 +17,7 @@ public class EfCoreEnterpriseRepository : EfCoreRepository FindByNameAsync( + public async virtual Task FindByNameAsync( string name, CancellationToken cancellationToken = default) { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Packages/PackageController.cs b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Packages/PackageController.cs index 1809e8df7..ba3ee6c7b 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Packages/PackageController.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Packages/PackageController.cs @@ -76,7 +76,7 @@ public class PackageController : PlatformControllerBase, IPackageAppService [Route("{Name}/latest")] [Route("{Name}/latest/{Version}")] [AllowAnonymous] - public virtual Task GetLatestAsync(PackageGetLatestInput input) + public virtual Task GetLatestAsync(PackageGetLatestInput input) { return _service.GetLatestAsync(input); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/LINGYUN/Platform/Settings/VueVbenAdmin/VueVbenAdminSettingDefinitionProvider.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/LINGYUN/Platform/Settings/VueVbenAdmin/VueVbenAdminSettingDefinitionProvider.cs index 655d9765a..198f2810f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/LINGYUN/Platform/Settings/VueVbenAdmin/VueVbenAdminSettingDefinitionProvider.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/LINGYUN/Platform/Settings/VueVbenAdmin/VueVbenAdminSettingDefinitionProvider.cs @@ -390,7 +390,7 @@ public class VueVbenAdminSettingDefinitionProvider : SettingDefinitionProvider string name, ILocalizableString displayName, ILocalizableString description, - string defaultValue = null, + string? defaultValue = null, bool isVisibleToClients = false, bool isInherited = true, bool isEncrypted = false) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/BeforeMiniStateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/BeforeMiniStateDto.cs index 77f57dafe..ad390fc54 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/BeforeMiniStateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/BeforeMiniStateDto.cs @@ -4,6 +4,6 @@ public class BeforeMiniStateDto { public bool? MenuCollapsed { get; set; } public bool? MenuSplit { get; set; } - public string MenuMode { get; set; } - public string MenuType { get; set; } + public string? MenuMode { get; set; } + public string? MenuType { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/HeaderSettingDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/HeaderSettingDto.cs index 3b006667e..a8c39b7ba 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/HeaderSettingDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/HeaderSettingDto.cs @@ -2,10 +2,10 @@ public class HeaderSettingDto { - public string BgColor { get; set; } = "#ffffff"; + public string? BgColor { get; set; } = "#ffffff"; public bool Fixed { get; set; } = true; public bool Show { get; set; } = true; - public string Theme { get; set; } = "light"; + public string? Theme { get; set; } = "light"; public bool ShowFullScreen { get; set; } = true; public bool UseLockPage { get; set; } = true; public bool ShowDoc { get; set; } = true; diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/MenuSettingDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/MenuSettingDto.cs index 832ca86b2..f92f03c45 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/MenuSettingDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/MenuSettingDto.cs @@ -2,7 +2,7 @@ public class MenuSettingDto { - public string BgColor { get; set; } = "#001529"; + public string? BgColor { get; set; } = "#001529"; public bool Fixed { get; set; } = true; public bool Collapsed { get; set; } public bool CanDrag { get; set; } @@ -10,14 +10,14 @@ public class MenuSettingDto public bool Hidden { get; set; } public bool Split { get; set; } public int MenuWidth { get; set; } = 210; - public string Mode { get; set; } = "inline"; - public string Type { get; set; } = "sidebar"; - public string Theme { get; set; } = "dark"; - public string TopMenuAlign { get; set; } = "center"; - public string Trigger { get; set; } = "HEADER"; + public string? Mode { get; set; } = "inline"; + public string? Type { get; set; } = "sidebar"; + public string? Theme { get; set; } = "dark"; + public string? TopMenuAlign { get; set; } = "center"; + public string? Trigger { get; set; } = "HEADER"; public bool Accordion { get; set; } = true; public bool CloseMixSidebarOnChange { get; set; } public bool CollapsedShowTitle { get; set; } - public string MixSideTrigger { get; set; } = "click"; + public string? MixSideTrigger { get; set; } = "click"; public bool MixSideFixed { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ProjectConfigDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ProjectConfigDto.cs index f1bb21a45..a58ddf8b6 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ProjectConfigDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ProjectConfigDto.cs @@ -5,14 +5,14 @@ public class ProjectConfigDto public int PermissionCacheType { get; set; } = 1; public bool ShowSettingButton { get; set; } = true; public bool ShowDarkModeToggle { get; set; } = true; - public string SettingButtonPosition { get; set; } = "auto"; - public string PermissionMode { get; set; } = "BACK"; + public string? SettingButtonPosition { get; set; } = "auto"; + public string? PermissionMode { get; set; } = "BACK"; public int SessionTimeoutProcessing { get; set; } = 0; public bool GrayMode { get; set; } public bool ColorWeak { get; set; } - public string ThemeColor { get; set; } = "#0960bd"; + public string? ThemeColor { get; set; } = "#0960bd"; public bool FullContent { get; set; } - public string ContentMode { get; set; } = "full"; + public string? ContentMode { get; set; } = "full"; public bool ShowLogo { get; set; } = true; public bool ShowFooter { get; set; } public HeaderSettingDto HeaderSetting { get; set; } = new HeaderSettingDto(); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ThemeSettingAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ThemeSettingAppService.cs index 3c63b1709..e1ae84fab 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ThemeSettingAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ThemeSettingAppService.cs @@ -248,7 +248,7 @@ public class ThemeSettingAppService : ApplicationService, IThemeSettingAppServic }; } - protected virtual string GetSettingValue(IEnumerable settings, string name, string defaultValue = null) + protected virtual string? GetSettingValue(IEnumerable settings, string name, string? defaultValue = null) { var settingValue = settings.FirstOrDefault(x => x.Name == name)?.Value; diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ThemeSettingDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ThemeSettingDto.cs index f079f2166..b7b316a7e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ThemeSettingDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/ThemeSettingDto.cs @@ -2,7 +2,7 @@ public class ThemeSettingDto { - public string DarkMode { get; set; } = "light"; + public string? DarkMode { get; set; } = "light"; public ProjectConfigDto ProjectConfig { get; set; } = new ProjectConfigDto(); public BeforeMiniStateDto BeforeMiniInfo { get; set; } = new BeforeMiniStateDto(); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/TransitionSettingDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/TransitionSettingDto.cs index 1ab5da735..6fdf01839 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/TransitionSettingDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN/Platform/Theme/VueVbenAdmin/TransitionSettingDto.cs @@ -3,7 +3,7 @@ public class TransitionSettingDto { public bool Enable { get; set; } = true; - public string BasicTransition { get; set; } = "fade-slide"; + public string? BasicTransition { get; set; } = "fade-slide"; public bool OpenPageLoading { get; set; } = true; public bool OpenNProgress { get; set; } } diff --git a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProductBuildLog.cs b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProductBuildLog.cs index 3d8d760ca..83ba1fbf8 100644 --- a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProductBuildLog.cs +++ b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProductBuildLog.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.ProjectManagement.Projects public class ProductBuildLog : Entity { public virtual Guid ProjectId { get; set; } - public virtual string Message { get; set; } + public virtual string Message { get; set; } = default!; public virtual LogLevel Level { get; set; } protected ProductBuildLog() { } public ProductBuildLog( diff --git a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/Project.cs b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/Project.cs index fe1163305..e2c98d650 100644 --- a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/Project.cs +++ b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/Project.cs @@ -6,17 +6,17 @@ namespace LINGYUN.Abp.ProjectManagement.Projects { public class Project : AuditedAggregateRoot { - public virtual string Name { get; protected set; } - public virtual string Version { get; protected set; } + public virtual string Name { get; protected set; } = default!; + public virtual string Version { get; protected set; } = default!; public virtual BuildStatus Status { get; protected set; } public virtual DateTime? BuildTime { get; protected set; } - public virtual string BuildError { get; protected set; } - public virtual string PackageIconUrl { get; protected set; } - public virtual string PackageProjectUrl { get; protected set; } - public virtual string PackageLicenseExpression { get; protected set; } + public virtual string? BuildError { get; protected set; } + public virtual string? PackageIconUrl { get; protected set; } + public virtual string? PackageProjectUrl { get; protected set; } + public virtual string? PackageLicenseExpression { get; protected set; } public virtual RepositoryType? RepositoryType { get; protected set; } - public virtual string RepositoryUrl { get; protected set; } - public virtual string Template { get; protected set; } + public virtual string? RepositoryUrl { get; protected set; } + public virtual string Template { get; protected set; } = default!; protected Project() { } public Project( Guid id, @@ -56,7 +56,7 @@ namespace LINGYUN.Abp.ProjectManagement.Projects BuildError = GetBaseExceptionError(ex); } - private static string GetBaseExceptionError(Exception ex) + private static string GetBaseExceptionError(Exception? ex) { if (ex == null) { diff --git a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectItem.cs b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectItem.cs index 6746e56c1..615376bbc 100644 --- a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectItem.cs +++ b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectItem.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.ProjectManagement.Projects { public class ProjectItem : AggregateRoot { - public virtual string Path { get; protected set; } - public virtual string Name { get; protected set; } + public virtual string Path { get; protected set; } = default!; + public virtual string Name { get; protected set; } = default!; } } diff --git a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectManager.cs b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectManager.cs index dbb96ada1..89a0ec8d5 100644 --- a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectManager.cs +++ b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectManager.cs @@ -68,7 +68,7 @@ namespace LINGYUN.Abp.ProjectManagement.Projects { projectBuildArgs = projectBuildArgs.Union( projectTemplate.ExtraProperties - .Select(x => new { x.Key, Value = x.Value?.ToString() ?? "" })); + .Select(x => new { x.Key, Value = x.Value?.ToString() })); } // 检查必须参数 var ignoredArgs = template.GetMustOptions().Where(x => !projectBuildArgs.Any(y => x.Key.Equals(y.Key))); diff --git a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectOptions.cs b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectOptions.cs index e380eeea8..6a3c25b9d 100644 --- a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectOptions.cs +++ b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectOptions.cs @@ -6,8 +6,8 @@ namespace LINGYUN.Abp.ProjectManagement.Projects public class ProjectOptions : Entity { public virtual Guid ProjectId { get; protected set; } - public virtual string Key { get; protected set; } - public virtual string Value { get; protected set; } + public virtual string Key { get; protected set; } = default!; + public virtual string? Value { get; protected set; } protected ProjectOptions() { } public ProjectOptions( Guid projectId, diff --git a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectTemplate.cs b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectTemplate.cs index cfe51bfee..f50988158 100644 --- a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectTemplate.cs +++ b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Projects/ProjectTemplate.cs @@ -10,7 +10,10 @@ namespace LINGYUN.Abp.ProjectManagement.Projects public virtual Guid ProjectId { get; protected set; } public virtual Guid TemplateId { get; protected set; } public virtual ICollection Options { get; protected set; } - protected ProjectTemplate() { } + protected ProjectTemplate() + { + Options = new Collection(); + } public ProjectTemplate( Guid id, Guid projectId, diff --git a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Templates/Template.cs b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Templates/Template.cs index 37237b84b..943eac34b 100644 --- a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Templates/Template.cs +++ b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Templates/Template.cs @@ -8,9 +8,12 @@ namespace LINGYUN.Abp.ProjectManagement.Templates { public class Template : AggregateRoot { - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; public virtual ICollection Options { get; protected set; } - protected Template() { } + protected Template() + { + Options = new Collection(); + } public Template( Guid id, string name) diff --git a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Templates/TemplateOptions.cs b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Templates/TemplateOptions.cs index ec15fff44..ab989616a 100644 --- a/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Templates/TemplateOptions.cs +++ b/aspnet-core/modules/project/LINGYUN.Abp.ProjectManagement.Domain/LINGYUN/Abp/ProjectManagement/Templates/TemplateOptions.cs @@ -6,10 +6,10 @@ namespace LINGYUN.Abp.ProjectManagement.Templates public class TemplateOptions : AggregateRoot { public virtual bool Optional { get; protected set; } - public virtual string Key { get; protected set; } - public virtual string FullKey { get; protected set; } + public virtual string Key { get; protected set; } = default!; + public virtual string FullKey { get; protected set; } = default!; public virtual OptionsType Type { get; protected set; } - public virtual string Description { get; protected set; } + public virtual string? Description { get; protected set; } protected TemplateOptions() { } public TemplateOptions( Guid id, @@ -17,7 +17,7 @@ namespace LINGYUN.Abp.ProjectManagement.Templates string fullKey, bool optional = true, OptionsType type = OptionsType.Empty, - string description = "") + string? description = null) : base(id) { Key = key; diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs index 93c11b4e0..a7cf8c710 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs @@ -25,9 +25,9 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs; [Authorize] public class MessagesHub : AbpHub { - protected IMessageProcessor Processor => LazyServiceProvider.LazyGetService(); + protected IMessageProcessor? Processor => LazyServiceProvider.LazyGetService(); - protected IUserOnlineChanger OnlineChanger => LazyServiceProvider.LazyGetService(); + protected IUserOnlineChanger? OnlineChanger => LazyServiceProvider.LazyGetService(); protected IDistributedIdGenerator DistributedIdGenerator => LazyServiceProvider.LazyGetRequiredService(); @@ -63,7 +63,7 @@ public class MessagesHub : AbpHub } } - public override async Task OnDisconnectedAsync(Exception exception) + public override async Task OnDisconnectedAsync(Exception? exception) { await base.OnDisconnectedAsync(exception); @@ -122,7 +122,10 @@ public class MessagesHub : AbpHub { try { - await Processor?.ReCallAsync(chatMessage); + if (Processor != null) + { + await Processor.ReCallAsync(chatMessage); + } if (!chatMessage.GroupId.IsNullOrWhiteSpace()) { await SendMessageAsync( @@ -148,7 +151,7 @@ public class MessagesHub : AbpHub await SendMessageAsync( Options.ReCallChatMessageMethod, ChatMessage.SystemLocalized( - chatMessage.ToUserId.Value, + chatMessage.ToUserId!.Value, chatMessage.FormUserId, new LocalizableStringInfo( LocalizationResourceNameAttribute.GetName(typeof(AbpIMResource)), @@ -177,9 +180,9 @@ public class MessagesHub : AbpHub await SendMessageAsync( Options.ReCallChatMessageMethod, ChatMessage.System( - chatMessage.ToUserId.Value, + chatMessage.ToUserId!.Value, chatMessage.FormUserId, - errorInfo.Message, + errorInfo.Message!, Clock, MessageType.Notifier, chatMessage.TenantId) @@ -194,7 +197,10 @@ public class MessagesHub : AbpHub { try { - await Processor?.ReadAsync(chatMessage); + if (Processor != null) + { + await Processor.ReadAsync(chatMessage); + } } catch (OperationCanceledException) { @@ -243,7 +249,7 @@ public class MessagesHub : AbpHub ChatMessage.System( chatMessage.FormUserId, chatMessage.GroupId, - errorInfo.Message, + errorInfo.Message!, Clock, MessageType.Notifier, chatMessage.TenantId)); @@ -253,9 +259,9 @@ public class MessagesHub : AbpHub await SendMessageToUserAsync( methodName, ChatMessage.System( - chatMessage.ToUserId.Value, + chatMessage.ToUserId!.Value, chatMessage.FormUserId, - errorInfo.Message, + errorInfo.Message!, Clock, MessageType.Notifier, chatMessage.TenantId)); diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs index bb76abc9c..0578d2b07 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs @@ -72,7 +72,7 @@ public class SignalRMessageSenderProvider : MessageSenderProviderBase { try { - var onlineClients = _hubContext.Clients.User(chatMessage.ToUserId.Value.ToString()); + var onlineClients = _hubContext.Clients.User(chatMessage.ToUserId!.Value.ToString()); if (onlineClients == null) { Logger.LogDebug("Can not get user " + chatMessage.ToUserId + " connection from SignalR hub!"); @@ -111,7 +111,7 @@ public class SignalRMessageSenderProvider : MessageSenderProviderBase ChatMessage.System( chatMessage.FormUserId, chatMessage.GroupId, - errorInfo.Message, + errorInfo.Message!, clock, chatMessage.MessageType, chatMessage.TenantId) @@ -123,8 +123,8 @@ public class SignalRMessageSenderProvider : MessageSenderProviderBase await TrySendMessageToUserAsync( ChatMessage.System( chatMessage.FormUserId, - chatMessage.ToUserId.Value, - errorInfo.Message, + chatMessage.ToUserId!.Value, + errorInfo.Message!, clock, chatMessage.MessageType, chatMessage.TenantId) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs index 8a879915f..8ced1c1ec 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs @@ -30,7 +30,7 @@ public interface IFriendStore Task> GetListAsync( Guid? tenantId, Guid userId, - string sorting = nameof(UserFriend.UserId), + string? sorting = nameof(UserFriend.UserId), CancellationToken cancellationToken = default ); /// @@ -43,7 +43,7 @@ public interface IFriendStore Task GetCountAsync( Guid? tenantId, Guid userId, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default); /// /// 获取好友列表 @@ -58,8 +58,8 @@ public interface IFriendStore Task> GetPagedListAsync( Guid? tenantId, Guid userId, - string filter = "", - string sorting = nameof(UserFriend.UserId), + string? filter = null, + string? sorting = nameof(UserFriend.UserId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); @@ -84,7 +84,7 @@ public interface IFriendStore /// /// /// - Task GetMemberAsync( + Task GetMemberAsync( Guid? tenantId, Guid userId, Guid friendId, @@ -100,7 +100,7 @@ public interface IFriendStore Guid? tenantId, Guid userId, Guid friendId, - string remarkName = "", + string? remarkName = null, bool isStatic = false, CancellationToken cancellationToken = default); /// @@ -115,8 +115,8 @@ public interface IFriendStore Guid? tenantId, Guid userId, Guid friendId, - string remarkName = "", - string description = "", + string? remarkName = null, + string? description = null, CancellationToken cancellationToken = default); /// /// 移除好友 diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriend.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriend.cs index 4097f900a..222a521c9 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriend.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriend.cs @@ -23,14 +23,14 @@ public class UserFriend : UserCard /// /// 备注名称 /// - public string RemarkName { get; set; } + public string? RemarkName { get; set; } public override int GetHashCode() { return FriendId.GetHashCode(); } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj == null) { diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendGroup.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendGroup.cs index cc164769c..e1d1cc7a3 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendGroup.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendGroup.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.IM.Contract; public class UserFriendGroup { public Guid? TenantId { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public List UserFriends { get; set; } = new List(); public void AddFriend(UserFriend friend) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/Group.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/Group.cs index 63eef222c..8214cb9ea 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/Group.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/Group.cs @@ -5,15 +5,15 @@ public class Group /// /// 群组标识 /// - public string Id { get; set; } + public string Id { get; set; } = default!; /// /// 群组名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 群组头像 /// - public string AvatarUrl { get; set; } + public string? AvatarUrl { get; set; } /// /// 允许匿名聊天 /// diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IGroupStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IGroupStore.cs index 8dae94497..cf5a1b316 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IGroupStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IGroupStore.cs @@ -27,7 +27,7 @@ public interface IGroupStore /// Task GetCountAsync( Guid? tenantId, - string filter = null, + string? filter = null, CancellationToken cancellationToken = default); /// /// 获取群组列表 @@ -41,8 +41,8 @@ public interface IGroupStore /// Task> GetListAsync( Guid? tenantId, - string filter = null, - string sorting = nameof(Group.Name), + string? filter = null, + string? sorting = nameof(Group.Name), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IUserGroupStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IUserGroupStore.cs index 15a107023..c85a85889 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IUserGroupStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IUserGroupStore.cs @@ -26,7 +26,7 @@ public interface IUserGroupStore /// /// /// - Task GetUserGroupCardAsync( + Task GetUserGroupCardAsync( Guid? tenantId, long groupId, Guid userId, @@ -73,7 +73,7 @@ public interface IUserGroupStore Task> GetMembersAsync( Guid? tenantId, long groupId, - string sorting = nameof(GroupUserCard.UserId), + string? sorting = nameof(GroupUserCard.UserId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserCardFinder.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserCardFinder.cs index 3d657b902..464bbf5de 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserCardFinder.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserCardFinder.cs @@ -20,7 +20,7 @@ public interface IUserCardFinder /// Task GetCountAsync( Guid? tenantId, - string findUserName = "", + string? findUserName = null, int? startAge = null, int? endAge = null, Sex? sex = null); @@ -38,7 +38,7 @@ public interface IUserCardFinder /// Task> GetListAsync( Guid? tenantId, - string findUserName = "", + string? findUserName = null, int? startAge = null, int? endAge = null, Sex? sex = null, @@ -51,7 +51,7 @@ public interface IUserCardFinder /// /// /// - Task GetMemberAsync( + Task GetMemberAsync( Guid? tenantId, Guid findUserId); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs index 020d0aaf1..d89afbdcb 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs @@ -18,14 +18,14 @@ public class ChatMessage : IHasExtraProperties /// /// 群组标识 /// - public string GroupId { get; set; } + public string GroupId { get; set; } = default!; /// /// 消息标识 /// /// /// 调用者无需关注此字段,将由服务自动生成 /// - public string MessageId { get; set; } + public string MessageId { get; set; } = default!; /// /// 发送者标识 /// @@ -33,7 +33,7 @@ public class ChatMessage : IHasExtraProperties /// /// 发送者名称 /// - public string FormUserName { get; set; } + public string FormUserName { get; set; } = default!; /// /// 接收用户标识 /// @@ -45,7 +45,7 @@ public class ChatMessage : IHasExtraProperties /// 消息内容 /// [DisableAuditing] - public string Content { get; set; } + public string Content { get; set; } = default!; /// /// 发送时间 /// diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs index 445ded07b..c42c82fcb 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs @@ -29,7 +29,7 @@ public interface IMessageStore Guid? tenantId, long groupId, MessageType? type = null, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default); /// /// 获取群组聊天记录 @@ -46,8 +46,8 @@ public interface IMessageStore Guid? tenantId, long groupId, MessageType? type = null, - string filter = "", - string sorting = nameof(ChatMessage.MessageId), + string? filter = null, + string? sorting = nameof(ChatMessage.MessageId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); @@ -64,7 +64,7 @@ public interface IMessageStore Guid? tenantId, Guid userId, MessageState? state = null, - string sorting = nameof(LastChatMessage.SendTime), + string? sorting = nameof(LastChatMessage.SendTime), int maxResultCount = 10, CancellationToken cancellationToken = default ); @@ -82,7 +82,7 @@ public interface IMessageStore Guid sendUserId, Guid receiveUserId, MessageType? type = null, - string filter = "", + string? filter = "", CancellationToken cancellationToken = default); /// /// 获取用户聊天记录 @@ -102,8 +102,8 @@ public interface IMessageStore Guid sendUserId, Guid receiveUserId, MessageType? type = null, - string filter = "", - string sorting = nameof(ChatMessage.MessageId), + string? filter = null, + string? sorting = nameof(ChatMessage.MessageId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/LastChatMessage.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/LastChatMessage.cs index 09340bb82..4550fcad9 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/LastChatMessage.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/LastChatMessage.cs @@ -9,8 +9,9 @@ namespace LINGYUN.Abp.IM.Messages; /// public class LastChatMessage : IHasExtraProperties { - public string AvatarUrl { get; set; } - public string Object { get; set; } + public string? AvatarUrl { get; set; } + + public string? Object { get; set; } /// /// 租户 /// @@ -18,14 +19,14 @@ public class LastChatMessage : IHasExtraProperties /// /// 群组标识 /// - public string GroupId { get; set; } + public string GroupId { get; set; } = default!; /// /// 消息标识 /// /// /// 调用者无需关注此字段,将由服务自动生成 /// - public string MessageId { get; set; } + public string MessageId { get; set; } = default!; /// /// 发送者标识 /// @@ -33,19 +34,19 @@ public class LastChatMessage : IHasExtraProperties /// /// 发送者名称 /// - public string FormUserName { get; set; } + public string FormUserName { get; set; } = default!; /// /// 接收用户标识 /// /// /// 设计为可空是为了兼容群聊消息 /// /remarks> - public string ToUserId { get; set; } + public string ToUserId { get; set; } = default!; /// /// 消息内容 /// [DisableAuditing] - public string Content { get; set; } + public string Content { get; set; } = default!; /// /// 发送时间 /// diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSendResult.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSendResult.cs index a4bf046cf..c0ed6ff45 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSendResult.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSendResult.cs @@ -3,11 +3,11 @@ public class MessageSendResult { public bool Success { get; } - public string Error { get; } + public string? Error { get; } public int Code { get; } public string Form { get; } public string To { get; } - public string Content { get; } + public string Content { get; } = default!; public static MessageSendResult Successed(string form, string to, string content) { return new MessageSendResult(form, to, content); diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs index d8c2bea62..34adfe4fe 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs @@ -15,7 +15,7 @@ public abstract class MessageSenderProviderBase : IMessageSenderProvider, ITrans protected ILoggerFactory LoggerFactory => ServiceProvider.LazyGetRequiredService(); protected ILogger Logger => _lazyLogger.Value; - private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); + private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName!) ?? NullLogger.Instance, true); protected MessageSenderProviderBase(IAbpLazyServiceProvider serviceProvider) { diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs index 4a6f6d4b5..1101fde00 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs @@ -25,7 +25,7 @@ public class MessageSenderProviderManager : IMessageSenderProviderManager, ISing () => Options .Providers .Select(type => serviceProvider.GetRequiredService(type) as IMessageSenderProvider) - .ToList(), + .ToList()!, true ); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserCard.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserCard.cs index 788d860d0..0891394ad 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserCard.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserCard.cs @@ -10,15 +10,15 @@ public class UserCard #region 细粒度的用户资料 - public string UserName { get; set; } + public string UserName { get; set; } = default!; /// /// 头像 /// - public string AvatarUrl { get; set; } + public string? AvatarUrl { get; set; } /// /// 昵称 /// - public string NickName { get; set; } + public string? NickName { get; set; } /// /// 年龄 /// @@ -30,11 +30,11 @@ public class UserCard /// /// 签名 /// - public string Sign { get; set; } + public string? Sign { get; set; } /// /// 说明 /// - public string Description { get; set; } + public string? Description { get; set; } /// /// 生日 /// diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetMyFriendsDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetMyFriendsDto.cs index 789b28ade..c64df5306 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetMyFriendsDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetMyFriendsDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.MessageService.Chat; public class GetMyFriendsDto : ISortedResultRequest { - public string Sorting { get; set; } + public string? Sorting { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetUserLastMessageDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetUserLastMessageDto.cs index 0365392b4..cbaec1744 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetUserLastMessageDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetUserLastMessageDto.cs @@ -3,9 +3,8 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.MessageService.Chat; -public class GetUserLastMessageDto : ILimitedResultRequest, ISortedResultRequest +public class GetUserLastMessageDto : LimitedResultRequestDto, ISortedResultRequest { - public int MaxResultCount { get; set; } - public string Sorting { get; set; } + public string? Sorting { get; set; } public MessageState? State { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupMessageGetByPagedDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupMessageGetByPagedDto.cs index c7e4f435f..28a032308 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupMessageGetByPagedDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupMessageGetByPagedDto.cs @@ -8,6 +8,6 @@ public class GroupMessageGetByPagedDto : PagedAndSortedResultRequestDto { [Required] public long GroupId { get; set; } - public string Filter { get; set; } + public string? Filter { get; set; } public MessageType? MessageType { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs index ba2819d38..2eb0277b1 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs @@ -2,5 +2,5 @@ public class MyFriendAddRequestDto : MyFriendOperationDto { - public string RemarkName { get; set; } + public string? RemarkName { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendGetByPagedDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendGetByPagedDto.cs index 5a7fe0811..d78bd1a1a 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendGetByPagedDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendGetByPagedDto.cs @@ -4,7 +4,7 @@ namespace LINGYUN.Abp.MessageService.Chat; public class MyFriendGetByPagedDto : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } public class MyLastContractFriendGetByPagedDto : PagedResultRequestDto diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserMessageGetByPagedDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserMessageGetByPagedDto.cs index 387af5921..3c51acdd3 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserMessageGetByPagedDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserMessageGetByPagedDto.cs @@ -9,6 +9,6 @@ public class UserMessageGetByPagedDto : PagedAndSortedResultRequestDto { [Required] public Guid ReceiveUserId { get; set; } - public string Filter { get; set; } + public string? Filter { get; set; } public MessageType? MessageType { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupAcceptUserDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupAcceptUserDto.cs index e44cbed80..7873d5dc2 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupAcceptUserDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupAcceptUserDto.cs @@ -14,5 +14,5 @@ public class GroupAcceptUserDto public bool AllowAccept { get; set; } = true; [StringLength(64)] - public string RejectReason { get; set; } + public string? RejectReason { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupSearchInput.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupSearchInput.cs index 6c37a8086..02d142c12 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupSearchInput.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupSearchInput.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.MessageService.Groups; public class GroupSearchInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupUserGetByPagedDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupUserGetByPagedDto.cs index 155f37241..538c9d996 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupUserGetByPagedDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupUserGetByPagedDto.cs @@ -8,5 +8,5 @@ public class GroupUserGetByPagedDto : PagedAndSortedResultRequestDto [Required] public long GroupId { get; set; } - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/UserJoinGroupDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/UserJoinGroupDto.cs index 12636997b..1fff34609 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/UserJoinGroupDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/UserJoinGroupDto.cs @@ -9,5 +9,5 @@ public class UserJoinGroupDto [Required] [StringLength(100)] - public string JoinInfo { get; set; } + public string JoinInfo { get; set; } = default!; } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/en.json b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/en.json index 32dc74af3..e2e672bd6 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/en.json +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/en.json @@ -8,14 +8,14 @@ "LINGYUN.Abp.Message:02400": "The administrator has turned on silence mode!", "LINGYUN.Abp.Message:02403": "The administrator has banned you from speaking!", "LINGYUN.Abp.Message:02401": "The administrator does not allow anonymous speaking!", - "LINGYUN.Abp.Message:02404": "Sending the message failed: the group does not exist or is disbanded!", + "LINGYUN.Abp.Message:02404": "The group does not exist or is disbanded!", "LINGYUN.Abp.Message:03301": "Friend request has been sent, waiting for the other party's approval", "LINGYUN.Abp.Message:03302": "You need to verify the problem to add friends", "LINGYUN.Abp.Message:03400": "The user has rejected all messages!", "LINGYUN.Abp.Message:03401": "The user rejects the message you sent!", "LINGYUN.Abp.Message:03402": "Users do not receive anonymous comments!", - "LINGYUN.Abp.Message:03403": "Sending the message failed: the person needs to agree to add a friend!", - "LINGYUN.Abp.Message:03404": "Sending the message failed: the user does not exist or is deactivated!", + "LINGYUN.Abp.Message:03403": "The person needs to agree to add a friend!", + "LINGYUN.Abp.Message:03404": "The user does not exist or is deactivated!", "LINGYUN.Abp.Message:03410": "Users refuse to add friends", "LINGYUN.Abp.Message:03411": "The other party is already your friend or has sent an authentication request. The operation cannot be repeated!", "Notifications:IM": "Instant Messaging", diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json index 617fefb89..448daff94 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json @@ -8,14 +8,14 @@ "LINGYUN.Abp.Message:02400": "管理员已开启全员禁言!", "LINGYUN.Abp.Message:02403": "管理员已禁止您发言!", "LINGYUN.Abp.Message:02401": "管理员不允许匿名发言!", - "LINGYUN.Abp.Message:02404": "发送消息失败: 群组不存在或已解散!", + "LINGYUN.Abp.Message:02404": "群组不存在或已解散!", "LINGYUN.Abp.Message:03301": "已发送好友申请,等待对方同意", "LINGYUN.Abp.Message:03302": "你需要验证问题才能添加好友", "LINGYUN.Abp.Message:03400": "用户已拒接所有消息!", "LINGYUN.Abp.Message:03401": "用户拒绝您发送的消息!", "LINGYUN.Abp.Message:03402": "用户不接收匿名发言!", "LINGYUN.Abp.Message:03403": "需要对方同意添加好友才能发送消息!", - "LINGYUN.Abp.Message:03404": "发送消息失败: 用户不存在或已注销账号!", + "LINGYUN.Abp.Message:03404": "用户不存在或已注销账号!", "LINGYUN.Abp.Message:03410": "用户拒绝添加好友", "LINGYUN.Abp.Message:03411": "对方已是您的好友或已发送验证请求,不能重复操作!", "Notifications:IM": "即时通讯", diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDbProperties.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDbProperties.cs index c772dc2db..f19ef6678 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDbProperties.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDbProperties.cs @@ -4,7 +4,7 @@ public class AbpMessageServiceDbProperties { public const string DefaultTablePrefix = "App"; - public const string DefaultSchema = null; + public const string? DefaultSchema = null; public const string ConnectionStringName = "MessageService"; } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs index 0cc49847b..c7e3d5948 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs @@ -57,7 +57,7 @@ public class FriendStore : IFriendStore, ITransientDependency Guid? tenantId, Guid userId, Guid friendId, - string remarkName = "", + string? remarkName = null, bool isStatic = false, CancellationToken cancellationToken = default) { @@ -75,7 +75,7 @@ public class FriendStore : IFriendStore, ITransientDependency var userChatFriend = await _userChatFriendRepository .FindByUserFriendIdAsync(friendId, userId); - userChatFriend.SetStatus(UserFriendStatus.Added); + userChatFriend!.SetStatus(UserFriendStatus.Added); await _userChatFriendRepository.UpdateAsync(userChatFriend, cancellationToken: cancellationToken); } @@ -86,8 +86,8 @@ public class FriendStore : IFriendStore, ITransientDependency Guid? tenantId, Guid userId, Guid friendId, - string remarkName = "", - string description = "", + string? remarkName = null, + string? description = null, CancellationToken cancellationToken = default) { using (_currentTenant.Change(tenantId)) @@ -137,7 +137,7 @@ public class FriendStore : IFriendStore, ITransientDependency public async virtual Task> GetListAsync( Guid? tenantId, Guid userId, - string sorting = nameof(UserFriend.UserId), + string? sorting = nameof(UserFriend.UserId), CancellationToken cancellationToken = default ) { @@ -150,7 +150,7 @@ public class FriendStore : IFriendStore, ITransientDependency public async virtual Task GetCountAsync( Guid? tenantId, Guid userId, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default) { using (_currentTenant.Change(tenantId)) @@ -163,8 +163,8 @@ public class FriendStore : IFriendStore, ITransientDependency public async virtual Task> GetPagedListAsync( Guid? tenantId, Guid userId, - string filter = "", - string sorting = nameof(UserFriend.UserId), + string? filter = null, + string? sorting = nameof(UserFriend.UserId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) @@ -192,7 +192,7 @@ public class FriendStore : IFriendStore, ITransientDependency } } - public async virtual Task GetMemberAsync( + public async virtual Task GetMemberAsync( Guid? tenantId, Guid userId, Guid friendId, @@ -253,7 +253,7 @@ public class FriendStore : IFriendStore, ITransientDependency protected async virtual Task> GetAllFriendByCacheItemAsync( Guid userId, - string sorting = nameof(UserFriend.UserId), + string? sorting = nameof(UserFriend.UserId), CancellationToken cancellationToken = default ) { diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IMessageRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IMessageRepository.cs index 7c56b1291..5b3a4e956 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IMessageRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IMessageRepository.cs @@ -25,11 +25,11 @@ public interface IMessageRepository GroupMessage groupMessage, CancellationToken cancellationToken = default); - Task GetUserMessageAsync( + Task GetUserMessageAsync( long id, CancellationToken cancellationToken = default); - Task GetGroupMessageAsync( + Task GetGroupMessageAsync( long id, CancellationToken cancellationToken = default); @@ -37,26 +37,26 @@ public interface IMessageRepository Guid sendUserId, Guid receiveUserId, MessageType? type = null, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default); Task GetCountAsync( long groupId, MessageType? type = null, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default); Task GetCountAsync( Guid sendUserId, Guid receiveUserId, MessageType? type = null, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default); Task> GetLastMessagesAsync( Guid userId, MessageState? state = null, - string sorting = nameof(LastChatMessage.SendTime), + string? sorting = nameof(LastChatMessage.SendTime), int maxResultCount = 10, CancellationToken cancellationToken = default); @@ -64,8 +64,8 @@ public interface IMessageRepository Guid sendUserId, Guid receiveUserId, MessageType? type = null, - string filter = "", - string sorting = nameof(UserMessage.MessageId), + string? filter = null, + string? sorting = nameof(UserMessage.MessageId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); @@ -73,14 +73,14 @@ public interface IMessageRepository Task GetGroupMessagesCountAsync( long groupId, MessageType? type = null, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default); Task> GetGroupMessagesAsync( long groupId, MessageType? type = null, - string filter = "", - string sorting = nameof(UserMessage.MessageId), + string? filter = null, + string? sorting = nameof(UserMessage.MessageId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); @@ -89,15 +89,15 @@ public interface IMessageRepository Guid sendUserId, long groupId, MessageType? type = null, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default); Task> GetUserGroupMessagesAsync( Guid sendUserId, long groupId, MessageType? type = null, - string filter = "", - string sorting = nameof(UserMessage.MessageId), + string? filter = null, + string? sorting = nameof(UserMessage.MessageId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatCardRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatCardRepository.cs index 2e966c12a..74d9f7d25 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatCardRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatCardRepository.cs @@ -9,7 +9,7 @@ namespace LINGYUN.Abp.MessageService.Chat; public interface IUserChatCardRepository : IBasicRepository { - Task FindByUserIdAsync( + Task FindByUserIdAsync( Guid userId, CancellationToken cancellationToken = default); @@ -18,23 +18,23 @@ public interface IUserChatCardRepository : IBasicRepository CancellationToken cancellationToken = default); Task GetMemberCountAsync( - string findUserName = "", + string? findUserName = null, int? startAge = null, int? endAge = null, Sex? sex = null, CancellationToken cancellationToken = default); Task> GetMembersAsync( - string findUserName = "", + string? findUserName = null, int? startAge = null, int? endAge = null, Sex? sex = null, - string sorting = nameof(UserChatCard.UserId), + string? sorting = nameof(UserChatCard.UserId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); - Task GetMemberAsync( + Task GetMemberAsync( Guid findUserId, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs index dc4d0e76e..e802a5772 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs @@ -19,25 +19,25 @@ public interface IUserChatFriendRepository : IBasicRepository FindByUserFriendIdAsync( + Task FindByUserFriendIdAsync( Guid userId, Guid friendId, CancellationToken cancellationToken = default); Task> GetAllMembersAsync( Guid userId, - string sorting = nameof(UserChatFriend.RemarkName), + string? sorting = nameof(UserChatFriend.RemarkName), CancellationToken cancellationToken = default); Task GetMembersCountAsync( Guid userId, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default); Task> GetMembersAsync( Guid userId, - string filter = "", - string sorting = nameof(UserChatFriend.UserId), + string? filter = null, + string? sorting = nameof(UserChatFriend.UserId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); @@ -48,7 +48,7 @@ public interface IUserChatFriendRepository : IBasicRepository GetMemberAsync( + Task GetMemberAsync( Guid userId, Guid friendId, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs index 0be3ad289..cd86d5745 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs @@ -8,5 +8,5 @@ namespace LINGYUN.Abp.MessageService.Chat; public interface IUserChatSettingRepository : IBasicRepository { Task UserHasOpendImAsync(Guid userId, CancellationToken cancellationToken = default); - Task FindByUserIdAsync(Guid userId, CancellationToken cancellationToken = default); + Task FindByUserIdAsync(Guid userId, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs index b16875ce9..107e0130d 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs @@ -19,11 +19,11 @@ public abstract class Message : CreationAuditedAggregateRoot, IMultiTenant /// /// 发送用户名称 /// - public virtual string SendUserName { get; protected set; } + public virtual string SendUserName { get; protected set; } = default!; /// /// 内容 /// - public virtual string Content { get; protected set; } + public virtual string Content { get; protected set; } = default!; /// /// 消息类型 /// diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageProcessor.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageProcessor.cs index b1db6d62e..e9472229f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageProcessor.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageProcessor.cs @@ -30,17 +30,17 @@ public class MessageProcessor : IMessageProcessor, ITransientDependency { if (!message.GroupId.IsNullOrWhiteSpace()) { - long messageId = long.Parse(message.MessageId); + var messageId = long.Parse(message.MessageId); var groupMessage = await _repository.GetGroupMessageAsync(messageId); - groupMessage.ChangeSendState(MessageState.Read); + groupMessage!.ChangeSendState(MessageState.Read); await _repository.UpdateGroupMessageAsync(groupMessage); } else { - long messageId = long.Parse(message.MessageId); + var messageId = long.Parse(message.MessageId); var userMessage = await _repository.GetUserMessageAsync(messageId); - userMessage.ChangeSendState(MessageState.Read); + userMessage!.ChangeSendState(MessageState.Read); await _repository.UpdateUserMessageAsync(userMessage); } @@ -56,15 +56,15 @@ public class MessageProcessor : IMessageProcessor, ITransientDependency if (!message.GroupId.IsNullOrWhiteSpace()) { - long messageId = long.Parse(message.MessageId); + var messageId = long.Parse(message.MessageId); var groupMessage = await _repository.GetGroupMessageAsync(messageId); - if (hasExpiredMessage(groupMessage)) + if (hasExpiredMessage(groupMessage!)) { throw new BusinessException(MessageServiceErrorCodes.ExpiredMessageCannotBeReCall) .WithData("Time", expiration); } - groupMessage.ChangeSendState(MessageState.ReCall); + groupMessage!.ChangeSendState(MessageState.ReCall); await _repository.UpdateGroupMessageAsync(groupMessage); } @@ -72,13 +72,13 @@ public class MessageProcessor : IMessageProcessor, ITransientDependency { long messageId = long.Parse(message.MessageId); var userMessage = await _repository.GetUserMessageAsync(messageId); - if (hasExpiredMessage(userMessage)) + if (hasExpiredMessage(userMessage!)) { throw new BusinessException(MessageServiceErrorCodes.ExpiredMessageCannotBeReCall) .WithData("Time", expiration); } - userMessage.ChangeSendState(MessageState.ReCall); + userMessage!.ChangeSendState(MessageState.ReCall); await _repository.UpdateUserMessageAsync(userMessage); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs index d2c6261a8..9e51fb8f1 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs @@ -73,8 +73,8 @@ public class MessageStore : IMessageStore, ITransientDependency Guid? tenantId, long groupId, MessageType? type = null, - string filter = "", - string sorting = nameof(ChatMessage.MessageId), + string? filter = null, + string? sorting = nameof(ChatMessage.MessageId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) @@ -102,8 +102,8 @@ public class MessageStore : IMessageStore, ITransientDependency Guid sendUserId, Guid receiveUserId, MessageType? type = null, - string filter = "", - string sorting = nameof(ChatMessage.MessageId), + string? filter = null, + string? sorting = nameof(ChatMessage.MessageId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) @@ -131,7 +131,7 @@ public class MessageStore : IMessageStore, ITransientDependency Guid? tenantId, Guid userId, MessageState? state = null, - string sorting = nameof(LastChatMessage.SendTime), + string? sorting = nameof(LastChatMessage.SendTime), int maxResultCount = 10, CancellationToken cancellationToken = default ) @@ -152,7 +152,7 @@ public class MessageStore : IMessageStore, ITransientDependency Guid? tenantId, long groupId, MessageType? type = null, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default) { using (_currentTenant.Change(tenantId)) @@ -166,7 +166,7 @@ public class MessageStore : IMessageStore, ITransientDependency Guid sendUserId, Guid receiveUserId, MessageType? type = null, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default) { using (_currentTenant.Change(tenantId)) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs index c2c71ac5e..f237cbf87 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs @@ -22,7 +22,7 @@ public class UserCardFinder : IUserCardFinder, ITransientDependency public async virtual Task GetCountAsync( Guid? tenantId, - string findUserName = "", + string? findUserName = null, int? startAge = null, int? endAge = null, Sex? sex = null) @@ -35,8 +35,8 @@ public class UserCardFinder : IUserCardFinder, ITransientDependency } public async virtual Task> GetListAsync( - Guid? tenantId, - string findUserName = "", + Guid? tenantId, + string? findUserName = null, int? startAge = null, int? endAge = null, Sex? sex = null, @@ -52,7 +52,7 @@ public class UserCardFinder : IUserCardFinder, ITransientDependency } } - public async virtual Task GetMemberAsync(Guid? tenantId, Guid findUserId) + public async virtual Task GetMemberAsync(Guid? tenantId, Guid findUserId) { using (_currentTenant.Change(tenantId)) { diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatCard.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatCard.cs index 734767fdc..8c4b3f461 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatCard.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatCard.cs @@ -23,7 +23,7 @@ public class UserChatCard : AuditedAggregateRoot, IMultiTenant /// /// 用户名 /// - public virtual string UserName { get; protected set; } + public virtual string UserName { get; protected set; } = default!; /// /// 性别 /// @@ -31,19 +31,19 @@ public class UserChatCard : AuditedAggregateRoot, IMultiTenant /// /// 签名 /// - public virtual string Sign { get; set; } + public virtual string? Sign { get; set; } /// /// 昵称 /// - public virtual string NickName { get; set; } + public virtual string? NickName { get; set; } /// /// 说明 /// - public virtual string Description { get; set; } + public virtual string? Description { get; set; } /// /// 头像地址 /// - public virtual string AvatarUrl { get; protected set; } + public virtual string? AvatarUrl { get; protected set; } /// /// 生日 /// @@ -65,8 +65,8 @@ public class UserChatCard : AuditedAggregateRoot, IMultiTenant Guid userId, string userName, Sex sex, - string nickName = null, - string avatarUrl = "", + string? nickName = null, + string? avatarUrl = null, Guid? tenantId = null) { Sex = sex; diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs index 533e71b55..c9a262f08 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs @@ -38,11 +38,11 @@ public class UserChatFriend : CreationAuditedAggregateRoot, IMultiTenant /// /// 备注名称 /// - public virtual string RemarkName { get; set; } + public virtual string? RemarkName { get; set; } /// /// 附加说明 /// - public virtual string Description { get; set; } + public virtual string? Description { get; set; } public virtual UserFriendStatus Status { get; protected set; } @@ -53,8 +53,8 @@ public class UserChatFriend : CreationAuditedAggregateRoot, IMultiTenant public UserChatFriend( Guid userId, Guid friendId, - string remarkName = "", - string description = "", + string? remarkName = null, + string? description = null, Guid? tenantId = null) { UserId = userId; diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriendGroup.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriendGroup.cs index 7168ce897..b2971783e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriendGroup.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriendGroup.cs @@ -21,5 +21,5 @@ public class UserChatFriendGroup : CreationAuditedEntity, IMultiTenant /// /// 显示名称 /// - public virtual string DisplayName { get; protected set; } + public virtual string? DisplayName { get; protected set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs index 4b5251585..31a1693a3 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs @@ -81,7 +81,7 @@ public class UserChatFriendEventHandler : { TenantId = tenantId, FormUserId = _currentUser.GetId(), // 本地事件中可以获取到当前用户信息 - FormUserName = _currentUser.UserName, + FormUserName = _currentUser.UserName!, SendTime = DateTime.Now, MessageType = MessageType.Text, ToUserId = friendId, @@ -105,13 +105,13 @@ public class UserChatFriendEventHandler : new LocalizableStringInfo( LocalizationResourceNameAttribute.GetName(typeof(MessageServiceResource)), "Notifications:RequestAddNewFriend", - new Dictionary { { "name", _currentUser.UserName } }), + new Dictionary { { "name", _currentUser.UserName! } }), DateTime.Now, - _currentUser.UserName, + _currentUser.UserName!, new LocalizableStringInfo( LocalizationResourceNameAttribute.GetName(typeof(MessageServiceResource)), "Notifications:RequestAddNewFriendDetail", - new Dictionary { { "description", userChatFriend.Description } })); + new Dictionary { { "description", userChatFriend.Description ?? "" } })); friendValidationNotifictionData.TrySetData("userId", userChatFriend.UserId); friendValidationNotifictionData.TrySetData("frientId", userChatFriend.FrientId); diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/ChatGroup.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/ChatGroup.cs index 1c77fa346..9b750237e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/ChatGroup.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/ChatGroup.cs @@ -24,19 +24,19 @@ public class ChatGroup : AuditedEntity, IMultiTenant /// /// 群组名称 /// - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; /// /// 群组标记 /// - public virtual string Tag { get; protected set; } + public virtual string? Tag { get; protected set; } /// /// 群组地址 /// - public virtual string Address { get; set; } + public virtual string? Address { get; set; } /// /// 群组公告 /// - public virtual string Notice { get; set; } + public virtual string? Notice { get; set; } /// /// 最大用户数量 /// @@ -52,11 +52,11 @@ public class ChatGroup : AuditedEntity, IMultiTenant /// /// 群组说明 /// - public virtual string Description { get; set; } + public virtual string? Description { get; set; } /// /// 群组头像地址 /// - public virtual string AvatarUrl { get; set; } + public virtual string? AvatarUrl { get; set; } protected ChatGroup() { } @@ -64,8 +64,8 @@ public class ChatGroup : AuditedEntity, IMultiTenant long id, Guid adminUserId, string name, - string tag = "", - string address = "", + string? tag = null, + string? address = null, int maxUserCount = 200) { GroupId = id; diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupStore.cs index c1ed0b110..5231d654e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupStore.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; using Volo.Abp.ObjectMapping; @@ -32,14 +33,14 @@ public class GroupStore : IGroupStore, ITransientDependency { using (_currentTenant.Change(tenantId)) { - var group = await _groupRepository.FindByIdAsync(long.Parse(groupId), cancellationToken); + var group = await _groupRepository.GetByIdAsync(long.Parse(groupId), cancellationToken); return _objectMapper.Map(group); } } public async virtual Task GetCountAsync( Guid? tenantId, - string filter = null, + string? filter = null, CancellationToken cancellationToken = default) { using (_currentTenant.Change(tenantId)) @@ -50,8 +51,8 @@ public class GroupStore : IGroupStore, ITransientDependency public async virtual Task> GetListAsync( Guid? tenantId, - string filter = null, - string sorting = nameof(Group.Name), + string? filter = null, + string? sorting = nameof(Group.Name), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepository.cs index c76142d4d..ebe009311 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepository.cs @@ -19,7 +19,7 @@ public interface IGroupRepository : IBasicRepository Guid formUserId, CancellationToken cancellationToken = default); - Task FindByIdAsync( + Task FindByIdAsync( long id, CancellationToken cancellationToken = default); @@ -34,7 +34,7 @@ public interface IGroupRepository : IBasicRepository /// /// Task GetCountAsync( - string filter = null, + string? filter = null, CancellationToken cancellationToken = default); /// /// 获取群组列表 @@ -46,8 +46,8 @@ public interface IGroupRepository : IBasicRepository /// /// Task> GetListAsync( - string filter = null, - string sorting = nameof(ChatGroup.Name), + string? filter = null, + string? sorting = nameof(ChatGroup.Name), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IUserChatGroupRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IUserChatGroupRepository.cs index 7c4152fc9..1d767da6c 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IUserChatGroupRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IUserChatGroupRepository.cs @@ -26,7 +26,7 @@ public interface IUserChatGroupRepository : IBasicRepository /// /// - Task GetMemberAsync( + Task GetMemberAsync( long groupId, Guid userId, CancellationToken cancellationToken = default); @@ -50,7 +50,7 @@ public interface IUserChatGroupRepository : IBasicRepository Task> GetMembersAsync( long groupId, - string sorting = nameof(GroupUserCard.UserId), + string? sorting = nameof(GroupUserCard.UserId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupCard.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupCard.cs index 47efafdae..7276cc4a8 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupCard.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupCard.cs @@ -21,7 +21,7 @@ public class UserGroupCard : AuditedAggregateRoot, IMultiTenant /// /// 昵称 /// - public virtual string NickName { get; set; } + public virtual string? NickName { get; set; } /// /// 是否管理员 /// diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupStore.cs index 1ca5de304..def19a73f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupStore.cs @@ -61,7 +61,7 @@ public class UserGroupStore : IUserGroupStore, ITransientDependency } } - public async Task GetUserGroupCardAsync( + public async Task GetUserGroupCardAsync( Guid? tenantId, long groupId, Guid userId, @@ -128,7 +128,7 @@ public class UserGroupStore : IUserGroupStore, ITransientDependency public async Task> GetMembersAsync( Guid? tenantId, long groupId, - string sorting = nameof(GroupUserCard.UserId), + string? sorting = nameof(GroupUserCard.UserId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/DateTimeHelper.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/DateTimeHelper.cs index ae63364aa..2041bf39e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/DateTimeHelper.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/DateTimeHelper.cs @@ -6,7 +6,7 @@ public static class DateTimeHelper { public static int CalcAgrByBirthdate(DateTime birthdate, DateTime nowTime) { - int age = nowTime.Year - birthdate.Year; + var age = nowTime.Year - birthdate.Year; if (nowTime.Month < birthdate.Month || (nowTime.Month == birthdate.Month && nowTime.Day < birthdate.Day)) { age--; diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreMessageRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreMessageRepository.cs index 6349998a4..ba610b739 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreMessageRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreMessageRepository.cs @@ -30,7 +30,7 @@ public class EfCoreMessageRepository : EfCoreRepository GetGroupMessageAsync( + public async virtual Task GetGroupMessageAsync( long id, CancellationToken cancellationToken = default) { @@ -43,8 +43,8 @@ public class EfCoreMessageRepository : EfCoreRepository> GetGroupMessagesAsync( long groupId, MessageType? type = null, - string filter = "", - string sorting = nameof(UserMessage.MessageId), + string? filter = null, + string? sorting = nameof(UserMessage.MessageId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) @@ -58,7 +58,7 @@ public class EfCoreMessageRepository : EfCoreRepository x.GroupId.Equals(groupId)) .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) .WhereIf(type.HasValue, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter!) || x.SendUserName.Contains(filter!)) .OrderBy(sorting) .PageBy(skipCount, maxResultCount) .AsNoTracking() @@ -70,7 +70,7 @@ public class EfCoreMessageRepository : EfCoreRepository GetGroupMessagesCountAsync( long groupId, MessageType? type = null, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default) { var groupMessagesCount = await (await GetDbContextAsync()).Set() @@ -78,7 +78,7 @@ public class EfCoreMessageRepository : EfCoreRepository x.GroupId.Equals(groupId)) .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) .WhereIf(type.HasValue, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter!) || x.SendUserName.Contains(filter!)) .LongCountAsync(GetCancellationToken(cancellationToken)); return groupMessagesCount; } @@ -87,8 +87,8 @@ public class EfCoreMessageRepository : EfCoreRepository x.GroupId.Equals(groupId) && x.CreatorId.Equals(sendUserId)) .WhereIf(type != null, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter!) || x.SendUserName.Contains(filter!)) .OrderBy(sorting) .PageBy(skipCount, maxResultCount) .AsNoTracking() @@ -114,13 +114,13 @@ public class EfCoreMessageRepository : EfCoreRepository() .Where(x => x.GroupId.Equals(groupId) && x.CreatorId.Equals(sendUserId)) .WhereIf(type != null, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter!) || x.SendUserName.Contains(filter!)) .LongCountAsync(GetCancellationToken(cancellationToken)); return groupMessagesCount; } @@ -128,13 +128,13 @@ public class EfCoreMessageRepository : EfCoreRepository GetCountAsync( long groupId, MessageType? type = null, - string filter = "", + string? filter = null, CancellationToken cancellationToken = default) { return await (await GetDbContextAsync()).Set() .Where(x => x.GroupId.Equals(groupId)) .WhereIf(type != null, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter!) || x.SendUserName.Contains(filter!)) .LongCountAsync(GetCancellationToken(cancellationToken)); } @@ -142,18 +142,18 @@ public class EfCoreMessageRepository : EfCoreRepository() .Where(x => (x.CreatorId.Equals(sendUserId) && x.ReceiveUserId.Equals(receiveUserId)) || x.CreatorId.Equals(receiveUserId) && x.ReceiveUserId.Equals(sendUserId)) .WhereIf(type != null, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter!) || x.SendUserName.Contains(filter!)) .LongCountAsync(GetCancellationToken(cancellationToken)); } - public async virtual Task GetUserMessageAsync( + public async virtual Task GetUserMessageAsync( long id, CancellationToken cancellationToken = default) { @@ -166,7 +166,7 @@ public class EfCoreMessageRepository : EfCoreRepository> GetLastMessagesAsync( Guid userId, MessageState? state = null, - string sorting = nameof(LastChatMessage.SendTime), + string? sorting = nameof(LastChatMessage.SendTime), int maxResultCount = 10, CancellationToken cancellationToken = default) { @@ -193,7 +193,7 @@ public class EfCoreMessageRepository : EfCoreRepository x.Type.Equals(type)) .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter!) || x.SendUserName.Contains(filter!)) .OrderBy(sorting) .PageBy(skipCount, maxResultCount) .AsNoTracking() @@ -273,7 +273,7 @@ public class EfCoreMessageRepository : EfCoreRepository() @@ -281,7 +281,7 @@ public class EfCoreMessageRepository : EfCoreRepository x.Type.Equals(type)) .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter!) || x.SendUserName.Contains(filter!)) .LongCountAsync(GetCancellationToken(cancellationToken)); return userMessagesCount; diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatCardRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatCardRepository.cs index b2cea8b6e..54439073a 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatCardRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatCardRepository.cs @@ -20,7 +20,7 @@ public class EfCoreUserChatCardRepository : EfCoreRepository FindByUserIdAsync( + public async virtual Task FindByUserIdAsync( Guid userId, CancellationToken cancellationToken = default) { @@ -36,7 +36,7 @@ public class EfCoreUserChatCardRepository : EfCoreRepository GetMemberAsync(Guid findUserId, CancellationToken cancellationToken = default) + public async virtual Task GetMemberAsync(Guid findUserId, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) .Where(ucc => ucc.UserId == findUserId) @@ -45,26 +45,26 @@ public class EfCoreUserChatCardRepository : EfCoreRepository GetMemberCountAsync( - string findUserName = "", + string? findUserName = null, int? startAge = null, int? endAge = null, Sex? sex = null, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) - .WhereIf(!findUserName.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(findUserName)) - .WhereIf(startAge.HasValue, ucc => ucc.Age >= startAge.Value) - .WhereIf(endAge.HasValue, ucc => ucc.Age <= endAge.Value) + .WhereIf(!findUserName.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(findUserName!)) + .WhereIf(startAge.HasValue, ucc => ucc.Age >= startAge) + .WhereIf(endAge.HasValue, ucc => ucc.Age <= endAge) .WhereIf(sex.HasValue, ucc => ucc.Sex == sex) .CountAsync(GetCancellationToken(cancellationToken)); } public async virtual Task> GetMembersAsync( - string findUserName = "", + string? findUserName = null, int? startAge = null, int? endAge = null, Sex? sex = null, - string sorting = nameof(UserChatCard.UserId), + string? sorting = nameof(UserChatCard.UserId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) @@ -74,9 +74,9 @@ public class EfCoreUserChatCardRepository : EfCoreRepository ucc.UserName.Contains(findUserName)) - .WhereIf(startAge.HasValue, ucc => ucc.Age >= startAge.Value) - .WhereIf(endAge.HasValue, ucc => ucc.Age <= endAge.Value) + .WhereIf(!findUserName.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(findUserName!)) + .WhereIf(startAge.HasValue, ucc => ucc.Age >= startAge) + .WhereIf(endAge.HasValue, ucc => ucc.Age <= endAge) .WhereIf(sex.HasValue, ucc => ucc.Sex == sex) .OrderBy(sorting) .PageBy(skipCount, maxResultCount) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs index f6bef66fe..dec0a1e6b 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs @@ -21,7 +21,7 @@ public class EfCoreUserChatFriendRepository : EfCoreRepository FindByUserFriendIdAsync(Guid userId, Guid friendId, CancellationToken cancellationToken = default) + public async virtual Task FindByUserFriendIdAsync(Guid userId, Guid friendId, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) .Where(ucf => ucf.UserId == userId && ucf.FrientId == friendId) @@ -30,7 +30,7 @@ public class EfCoreUserChatFriendRepository : EfCoreRepository> GetAllMembersAsync( Guid userId, - string sorting = nameof(UserChatFriend.RemarkName), + string? sorting = nameof(UserChatFriend.RemarkName), CancellationToken cancellationToken = default) { if (sorting.IsNullOrWhiteSpace()) @@ -68,7 +68,7 @@ public class EfCoreUserChatFriendRepository : EfCoreRepository GetMemberAsync(Guid userId, Guid friendId, CancellationToken cancellationToken = default) + public async virtual Task GetMemberAsync(Guid userId, Guid friendId, CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(); var userFriendQuery = from ucf in dbContext.Set() @@ -101,8 +101,8 @@ public class EfCoreUserChatFriendRepository : EfCoreRepository> GetMembersAsync( Guid userId, - string filter = "", - string sorting = nameof(UserChatFriend.UserId), + string? filter = null, + string? sorting = nameof(UserChatFriend.UserId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) @@ -114,12 +114,12 @@ public class EfCoreUserChatFriendRepository : EfCoreRepository() - .WhereIf(!filter.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(filter) || ucc.NickName.Contains(filter)); + .WhereIf(!filter.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(filter!) || ucc.NickName!.Contains(filter!)); // 过滤好友资料 var userChatFriendQuery = dbContext.Set() .Where(ucf => ucf.Status == UserFriendStatus.Added) - .WhereIf(!filter.IsNullOrWhiteSpace(), ucf => ucf.RemarkName.Contains(filter)); + .WhereIf(!filter.IsNullOrWhiteSpace(), ucf => ucf.RemarkName!.Contains(filter!)); // 组合查询 var userFriendQuery = from ucf in userChatFriendQuery @@ -194,15 +194,15 @@ public class EfCoreUserChatFriendRepository : EfCoreRepository GetMembersCountAsync(Guid userId, string filter = "", CancellationToken cancellationToken = default) + public async virtual Task GetMembersCountAsync(Guid userId, string? filter = null, CancellationToken cancellationToken = default) { var dbContext = await GetDbContextAsync(); var userChatCardQuery = dbContext.Set() - .WhereIf(!filter.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(filter) || ucc.NickName.Contains(filter)); + .WhereIf(!filter.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(filter!) || ucc.NickName!.Contains(filter!)); var userChatFriendQuery = dbContext.Set() .Where(ucf => ucf.Status == UserFriendStatus.Added) - .WhereIf(!filter.IsNullOrWhiteSpace(), ucf => ucf.RemarkName.Contains(filter)); + .WhereIf(!filter.IsNullOrWhiteSpace(), ucf => ucf.RemarkName!.Contains(filter!)); var userFriendQuery = from ucf in userChatFriendQuery join ucc in userChatCardQuery diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs index 7e12bebe2..a6b731883 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs @@ -19,7 +19,7 @@ public class EfCoreUserChatSettingRepository : EfCoreRepository FindByUserIdAsync(Guid userId, CancellationToken cancellationToken = default) + public async Task FindByUserIdAsync(Guid userId, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()).Where(x => x.UserId.Equals(userId)) .AsNoTracking() diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs index ffa2f13dc..e83bdb95f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs @@ -11,7 +11,7 @@ public static class MessageServiceDbContextModelCreatingExtensions { public static void ConfigureMessageService( this ModelBuilder builder, - Action optionsAction = null) + Action? optionsAction = null) { Check.NotNull(builder, nameof(builder)); diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceModelBuilderConfigurationOptions.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceModelBuilderConfigurationOptions.cs index abc6f6904..49c22b065 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceModelBuilderConfigurationOptions.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceModelBuilderConfigurationOptions.cs @@ -7,7 +7,7 @@ public class MessageServiceModelBuilderConfigurationOptions : AbpModelBuilderCon { public MessageServiceModelBuilderConfigurationOptions( [NotNull] string tablePrefix = AbpMessageServiceDbProperties.DefaultTablePrefix, - [CanBeNull] string schema = AbpMessageServiceDbProperties.DefaultSchema) + [CanBeNull] string? schema = AbpMessageServiceDbProperties.DefaultSchema) : base( tablePrefix, schema) diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreGroupRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreGroupRepository.cs index f9a032f66..081b19c82 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreGroupRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreGroupRepository.cs @@ -23,18 +23,18 @@ public class EfCoreGroupRepository : EfCoreRepository GetCountAsync( - string filter = null, + string? filter = null, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Name.Contains(filter) || x.Tag.Contains(filter)) + x.Name.Contains(filter!) || x.Tag!.Contains(filter!)) .CountAsync(GetCancellationToken(cancellationToken)); } public async virtual Task> GetListAsync( - string filter = null, - string sorting = nameof(ChatGroup.Name), + string? filter = null, + string? sorting = nameof(ChatGroup.Name), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) @@ -45,13 +45,13 @@ public class EfCoreGroupRepository : EfCoreRepository - x.Name.Contains(filter) || x.Tag.Contains(filter)) + x.Name.Contains(filter!) || x.Tag!.Contains(filter!)) .OrderBy(sorting) .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellationToken)); } - public async virtual Task FindByIdAsync( + public async virtual Task FindByIdAsync( long id, CancellationToken cancellationToken = default) { diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreUserChatGroupRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreUserChatGroupRepository.cs index 366c2c6f3..e9ba570ad 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreUserChatGroupRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreUserChatGroupRepository.cs @@ -22,7 +22,7 @@ public class EfCoreUserChatGroupRepository : EfCoreRepository GetMemberAsync( + public async virtual Task GetMemberAsync( long groupId, Guid userId, CancellationToken cancellationToken = default) @@ -59,7 +59,7 @@ public class EfCoreUserChatGroupRepository : EfCoreRepository> GetMembersAsync( long groupId, - string sorting = nameof(UserChatCard.UserId), + string? sorting = nameof(UserChatCard.UserId), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs index a20394e7a..42ee51bc5 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs @@ -36,8 +36,7 @@ public class AbpNotificationsExceptionSubscriber : AbpExceptionSubscriberBase { "loglevel", context.LogLevel.ToString() }, { "stackTrace", context.Exception.ToString() }, }), - user: null, - CurrentTenant.Id, - NotificationSeverity.Error); + tenantId: CurrentTenant.Id, + severity: NotificationSeverity.Error); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionCreateDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionCreateDto.cs index e0b558421..135c84548 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionCreateDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionCreateDto.cs @@ -7,5 +7,5 @@ public class NotificationGroupDefinitionCreateDto : NotificationGroupDefinitionC { [Required] [DynamicStringLength(typeof(NotificationDefinitionGroupRecordConsts), nameof(NotificationDefinitionGroupRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionCreateOrUpdateDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionCreateOrUpdateDto.cs index 97a55f8fa..1a9398f7d 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionCreateOrUpdateDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionCreateOrUpdateDto.cs @@ -8,10 +8,10 @@ public abstract class NotificationGroupDefinitionCreateOrUpdateDto : IHasExtraPr { [Required] [DynamicStringLength(typeof(NotificationDefinitionGroupRecordConsts), nameof(NotificationDefinitionGroupRecordConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(NotificationDefinitionGroupRecordConsts), nameof(NotificationDefinitionGroupRecordConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } public bool AllowSubscriptionToClients { get; set; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionDto.cs index 81fff89dd..6a6b7a5bf 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionDto.cs @@ -4,9 +4,9 @@ namespace LINGYUN.Abp.Notifications.Definitions.Groups; public class NotificationGroupDefinitionDto : ExtensibleObject { - public string Name { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } + public string Name { get; set; } = default!; + public string? DisplayName { get; set; } + public string? Description { get; set; } public bool IsStatic { get; set; } public bool AllowSubscriptionToClients { get; set; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionGetListInput.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionGetListInput.cs index 20011b80a..7b419ab9b 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionGetListInput.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Groups/Dto/NotificationGroupDefinitionGetListInput.cs @@ -1,5 +1,5 @@ namespace LINGYUN.Abp.Notifications.Definitions.Groups; public class NotificationGroupDefinitionGetListInput { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionCreateDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionCreateDto.cs index 9f84e43c2..cc97d5f10 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionCreateDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionCreateDto.cs @@ -7,9 +7,9 @@ public class NotificationDefinitionCreateDto : NotificationDefinitionCreateOrUpd { [Required] [DynamicStringLength(typeof(NotificationDefinitionRecordConsts), nameof(NotificationDefinitionRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] [DynamicStringLength(typeof(NotificationDefinitionGroupRecordConsts), nameof(NotificationDefinitionGroupRecordConsts.MaxNameLength))] - public string GroupName { get; set; } + public string GroupName { get; set; } = default!; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionCreateOrUpdateDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionCreateOrUpdateDto.cs index 34a57e2e6..d4f5ac155 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionCreateOrUpdateDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionCreateOrUpdateDto.cs @@ -8,14 +8,14 @@ namespace LINGYUN.Abp.Notifications.Definitions.Notifications; public abstract class NotificationDefinitionCreateOrUpdateDto : IHasExtraProperties { [DynamicStringLength(typeof(NotificationDefinitionRecordConsts), nameof(NotificationDefinitionRecordConsts.MaxTemplateLength))] - public string Template { get; set; } + public string? Template { get; set; } [Required] [DynamicStringLength(typeof(NotificationDefinitionRecordConsts), nameof(NotificationDefinitionRecordConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(NotificationDefinitionRecordConsts), nameof(NotificationDefinitionRecordConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } public bool AllowSubscriptionToClients { get; set; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionDto.cs index e73500a5c..2f0c476df 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionDto.cs @@ -5,15 +5,15 @@ namespace LINGYUN.Abp.Notifications.Definitions.Notifications; public class NotificationDefinitionDto : ExtensibleObject { - public string Name { get; set; } + public string Name { get; set; } = default!; public bool IsStatic { get; set; } - public string GroupName { get; set; } + public string GroupName { get; set; } = default!; - public string DisplayName { get; set; } + public string? DisplayName { get; set; } - public string Description { get; set; } + public string? Description { get; set; } public bool AllowSubscriptionToClients { get; set; } @@ -25,5 +25,5 @@ public class NotificationDefinitionDto : ExtensibleObject public List Providers { get; set; } = new List(); - public string Template { get; set; } + public string? Template { get; set; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionGetListInput.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionGetListInput.cs index 667fb4464..933016e86 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionGetListInput.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Definitions/Notifications/Dto/NotificationDefinitionGetListInput.cs @@ -1,9 +1,9 @@ namespace LINGYUN.Abp.Notifications.Definitions.Notifications; public class NotificationDefinitionGetListInput { - public string Filter { get; set; } - public string GroupName { get; set; } - public string Template { get; set; } + public string? Filter { get; set; } + public string? GroupName { get; set; } + public string? Template { get; set; } public bool? AllowSubscriptionToClients { get; set; } public NotificationLifetime? NotificationLifetime { get; set; } public NotificationType? NotificationType { get; set; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationDto.cs index d8df23af7..c76fa56f4 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationDto.cs @@ -5,15 +5,15 @@ public class NotificationDto /// /// 通知名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 显示名称 /// - public string DisplayName { get; set; } + public string? DisplayName { get; set; } /// /// 说明 /// - public string Description { get; set; } + public string? Description { get; set; } /// /// 存活类型 /// diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGroupDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGroupDto.cs index 498d42b20..b018d7a61 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGroupDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGroupDto.cs @@ -4,7 +4,7 @@ namespace LINGYUN.Abp.Notifications; public class NotificationGroupDto { - public string Name { get; set; } - public string DisplayName { get; set; } + public string Name { get; set; } = default!; + public string? DisplayName { get; set; } public List Notifications { get; set; } = new List(); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationMarkReadStateInput.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationMarkReadStateInput.cs index a45ab047e..9b8e4af07 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationMarkReadStateInput.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationMarkReadStateInput.cs @@ -7,7 +7,7 @@ public class NotificationMarkReadStateInput { [Required] [DisplayName("Notifications:Id")] - public long[] IdList { get; set; } + public long[] IdList { get; set; } = default!; [DisplayName("Notifications:State")] public NotificationReadState State { get; set; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationProviderDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationProviderDto.cs index fe5402e5a..4b05557eb 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationProviderDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationProviderDto.cs @@ -2,5 +2,5 @@ public class NotificationProviderDto { - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendDto.cs index e88189536..6a293e65b 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendDto.cs @@ -9,13 +9,13 @@ public class NotificationSendDto [Required] [StringLength(NotificationConsts.MaxNameLength)] [DisplayName("Notifications:Name")] - public string Name { get; set; } + public string Name { get; set; } = default!; [DisplayName("Notifications:Data")] - public Dictionary Data { get; set; } = new Dictionary(); + public Dictionary Data { get; set; } = new Dictionary(); [DisplayName("Notifications:Culture")] - public string Culture { get; set; } + public string? Culture { get; set; } [DisplayName("Notifications:ToUserId")] public List ToUsers { get; set; } = new List(); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendRecordDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendRecordDto.cs index 2706ef671..f6ace1b1c 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendRecordDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendRecordDto.cs @@ -4,11 +4,11 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.Notifications; public class NotificationSendRecordDto : EntityDto { - public string Provider { get; set; } + public string Provider { get; set; } = default!; public DateTime SendTime { get; set; } public Guid UserId { get; set; } - public string UserName { get; set; } + public string UserName { get; set; } = default!; public NotificationSendState State { get; set; } - public string Reason { get; set; } - public UserNotificationDto Notification { get; set; } + public string? Reason { get; set; } + public UserNotificationDto Notification { get; set; } = default!; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendRecordGetPagedListInput.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendRecordGetPagedListInput.cs index e1b19dd67..6b11cfc00 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendRecordGetPagedListInput.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationSendRecordGetPagedListInput.cs @@ -3,7 +3,6 @@ using Volo.Abp.Application.Dtos; namespace LINGYUN.Abp.Notifications; -#nullable enable public class NotificationSendRecordGetPagedListInput : PagedAndSortedResultRequestDto { public string? Provider { get; set; } @@ -13,4 +12,3 @@ public class NotificationSendRecordGetPagedListInput : PagedAndSortedResultReque public string? NotificationName { get; set; } public NotificationSendState? State { get; set; } } -#nullable disable diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationTemplateDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationTemplateDto.cs index 062cdc2f3..55a07de69 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationTemplateDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationTemplateDto.cs @@ -2,9 +2,9 @@ public class NotificationTemplateDto { - public string Name { get; set; } - public string Description { get; set; } - public string Title { get; set; } - public string Content { get; set; } - public string Culture { get; set; } + public string Name { get; set; } = default!; + public string? Description { get; set; } + public string? Title { get; set; } + public string? Content { get; set; } + public string? Culture { get; set; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/SubscriptionsGetByNameDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/SubscriptionsGetByNameDto.cs index 402e1a8ec..79799d270 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/SubscriptionsGetByNameDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/SubscriptionsGetByNameDto.cs @@ -8,5 +8,5 @@ public class SubscriptionsGetByNameDto [Required] [StringLength(NotificationConsts.MaxNameLength)] [DisplayName("Notifications:Name")] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationDto.cs index 7b4c95418..f5331674e 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationDto.cs @@ -4,9 +4,9 @@ namespace LINGYUN.Abp.Notifications; public class UserNotificationDto { - public string Name { get; set; } - public string Id { get; set; } - public NotificationData Data { get; set; } + public string Name { get; set; } = default!; + public string Id { get; set; } = default!; + public NotificationData Data { get; set; } = default!; public DateTime CreationTime { get; set; } public NotificationType Type { get; set; } public NotificationLifetime Lifetime { get; set; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationGetByNameDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationGetByNameDto.cs index 506b6fef4..2d3065ae0 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationGetByNameDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationGetByNameDto.cs @@ -8,5 +8,5 @@ public class UserNotificationGetByNameDto [Required] [StringLength(NotificationConsts.MaxNameLength)] [DisplayName("Notifications:Name")] - public string NotificationName { get; set; } + public string NotificationName { get; set; } = default!; } \ No newline at end of file diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationGetByPagedDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationGetByPagedDto.cs index e3510ba12..20cfcb27d 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationGetByPagedDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserNotificationGetByPagedDto.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.Notifications; public class UserNotificationGetByPagedDto : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } [DisplayName("Notifications:State")] public NotificationReadState? ReadState { get; set; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserSubscreNotificationDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserSubscreNotificationDto.cs index 7adbc9875..346b69f85 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserSubscreNotificationDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/UserSubscreNotificationDto.cs @@ -2,5 +2,5 @@ public class UserSubscreNotificationDto { - public string Name { get; set; } + public string Name { get; set; } = default!; } \ No newline at end of file diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationMappers.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationMappers.cs index adfe86b05..68661b55d 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationMappers.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationMappers.cs @@ -23,7 +23,7 @@ public partial class UserNotificationInfoToUserNotificationDtoMapper : MapperBas if (source != null) { var dataType = Type.GetType(source.NotificationTypeName); - var data = Activator.CreateInstance(dataType); + var data = Activator.CreateInstance(dataType!); if (data is NotificationData notificationData) { notificationData.ExtraProperties = source.ExtraProperties; diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionAppService.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionAppService.cs index 621307063..c48978bb7 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionAppService.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionAppService.cs @@ -47,7 +47,7 @@ public class NotificationGroupDefinitionAppService : AbpNotificationsApplication await _definitionGroupRecordRepository.InsertAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(definitionRecord); } @@ -63,7 +63,7 @@ public class NotificationGroupDefinitionAppService : AbpNotificationsApplication await _definitionGroupRecordRepository.DeleteAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(string name) @@ -103,7 +103,7 @@ public class NotificationGroupDefinitionAppService : AbpNotificationsApplication UpdateByInput(definitionRecord, input); definitionRecord = await _definitionGroupRecordRepository.UpdateAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(definitionRecord); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionAppService.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionAppService.cs index c467f9b03..b7a1d09ef 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionAppService.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionAppService.cs @@ -54,7 +54,7 @@ public class NotificationDefinitionAppService : AbpNotificationsApplicationServi await _definitionRecordRepository.InsertAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(definitionRecord); } @@ -70,7 +70,7 @@ public class NotificationDefinitionAppService : AbpNotificationsApplicationServi await _definitionRecordRepository.DeleteAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(string name) @@ -88,7 +88,7 @@ public class NotificationDefinitionAppService : AbpNotificationsApplicationServi Expression> expression = _ => true; if (!input.Filter.IsNullOrWhiteSpace()) { - expression = expression.And(x => x.Name.Contains(input.Filter) || x.DisplayName.Contains(input.Filter)); + expression = expression.And(x => x.Name.Contains(input.Filter) || x.DisplayName!.Contains(input.Filter)); } if (!input.Template.IsNullOrWhiteSpace()) { @@ -130,7 +130,7 @@ public class NotificationDefinitionAppService : AbpNotificationsApplicationServi UpdateByInput(definitionRecord, input); definitionRecord = await _definitionRecordRepository.UpdateAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(definitionRecord); } @@ -163,7 +163,7 @@ public class NotificationDefinitionAppService : AbpNotificationsApplicationServi { record.Description = input.Description; } - string allowedProviders = null; + string? allowedProviders = null; if (!input.Providers.IsNullOrEmpty()) { allowedProviders = input.Providers.JoinAsString(","); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/NotificationAppService.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/NotificationAppService.cs index 49bc2738d..fd930cca8 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/NotificationAppService.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/NotificationAppService.cs @@ -110,7 +110,7 @@ public class NotificationAppService : AbpNotificationsApplicationServiceBase, IN Name = notification.Name, Culture = CultureInfo.CurrentCulture.Name, Title = notification.DisplayName.Localize(StringLocalizerFactory), - Description = notification.Description?.Localize(StringLocalizerFactory), + Description = notification.Description?.Localize(StringLocalizerFactory)?.Value, }); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationTemplateDefinitionProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationTemplateDefinitionProvider.cs index 4b2ba789f..d9b1210ca 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationTemplateDefinitionProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationTemplateDefinitionProvider.cs @@ -19,7 +19,7 @@ public class AbpNotificationTemplateDefinitionProvider : TemplateDefinitionProvi foreach (var notification in notifications.Where(n => n.Template != null)) { - if (context.GetOrNull(notification.Template.Name) == null) + if (context.GetOrNull(notification.Template!.Name) == null) { context.Add(notification.Template); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/IDynamicNotificationDefinitionStore.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/IDynamicNotificationDefinitionStore.cs index de4faeef3..bf69b0817 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/IDynamicNotificationDefinitionStore.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/IDynamicNotificationDefinitionStore.cs @@ -5,11 +5,11 @@ namespace LINGYUN.Abp.Notifications; public interface IDynamicNotificationDefinitionStore { - Task GetOrNullAsync(string name); + Task GetOrNullAsync(string name); Task> GetNotificationsAsync(); - Task GetGroupOrNullAsync(string name); + Task GetGroupOrNullAsync(string name); Task> GetGroupsAsync(); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs index 2d583e56a..ec0a31ef6 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs @@ -7,11 +7,11 @@ public interface INotificationDefinitionContext { NotificationGroupDefinition AddGroup( [NotNull] string name, - ILocalizableString displayName = null, - ILocalizableString description = null, + ILocalizableString? displayName = null, + ILocalizableString? description = null, bool allowSubscriptionToClients = true); - NotificationGroupDefinition GetGroupOrNull(string name); + NotificationGroupDefinition? GetGroupOrNull(string name); void RemoveGroup(string name); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs index 4793bf3f4..fb778d848 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs @@ -11,9 +11,9 @@ public interface INotificationDefinitionManager Task> GetNotificationsAsync(); - Task GetOrNullAsync(string name); + Task GetOrNullAsync(string name); - Task GetGroupOrNullAsync(string name); + Task GetGroupOrNullAsync(string name); Task> GetGroupsAsync(); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/IStaticNotificationDefinitionStore.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/IStaticNotificationDefinitionStore.cs index 7d8a55d96..e181ba8bb 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/IStaticNotificationDefinitionStore.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/IStaticNotificationDefinitionStore.cs @@ -5,11 +5,11 @@ namespace LINGYUN.Abp.Notifications; public interface IStaticNotificationDefinitionStore { - Task GetOrNullAsync(string name); + Task GetOrNullAsync(string name); Task> GetNotificationsAsync(); - Task GetGroupOrNullAsync(string name); + Task GetGroupOrNullAsync(string name); Task> GetGroupsAsync(); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationData.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationData.cs index 607c23a15..af32f04b3 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationData.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationData.cs @@ -26,9 +26,9 @@ public class NotificationData : IHasExtraProperties /// public const string CultureKey = "C"; - public virtual string Type => GetType().FullName; + public virtual string Type => GetType().FullName!; - public object this[string key] + public object? this[string key] { get { @@ -40,7 +40,7 @@ public class NotificationData : IHasExtraProperties } } - public ExtraPropertyDictionary ExtraProperties { get; set; } + public ExtraPropertyDictionary ExtraProperties { get; set; } = default!; public NotificationData() { @@ -63,8 +63,8 @@ public class NotificationData : IHasExtraProperties LocalizableStringInfo message, DateTime createTime, string formUser, - LocalizableStringInfo description = null, - string culture = null) + LocalizableStringInfo? description = null, + string? culture = null) { TrySetData("title", title); TrySetData("message", message); @@ -147,11 +147,11 @@ public class NotificationData : IHasExtraProperties return data; } - public object TryGetData(string key) + public object? TryGetData(string key) { return this.GetProperty(key); } - public void TrySetData(string key, object value) + public void TrySetData(string key, object? value) { this.SetProperty(key, value); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinition.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinition.cs index 1af202706..a5f7f12bd 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinition.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinition.cs @@ -28,12 +28,12 @@ public class NotificationDefinition get => _displayName; set => _displayName = Check.NotNull(value, nameof(value)); } - private ILocalizableString _displayName; + private ILocalizableString _displayName = default!; /// /// 通知说明 /// [CanBeNull] - public ILocalizableString Description { get; set; } + public ILocalizableString? Description { get; set; } /// /// 允许客户端显示订阅 /// @@ -57,22 +57,22 @@ public class NotificationDefinition /// /// 通知模板 /// - public TemplateDefinition Template { get; private set; } + public TemplateDefinition? Template { get; private set; } /// /// 额外属性 /// [NotNull] - public Dictionary Properties { get; } + public Dictionary Properties { get; } - public object this[string name] { + public object? this[string name] { get => Properties.GetOrDefault(name); set => Properties[name] = value; } public NotificationDefinition( string name, - ILocalizableString displayName = null, - ILocalizableString description = null, + ILocalizableString? displayName = null, + ILocalizableString? description = null, NotificationType notificationType = NotificationType.Application, NotificationLifetime lifetime = NotificationLifetime.Persistent, NotificationContentType contentType = NotificationContentType.Text, @@ -87,7 +87,7 @@ public class NotificationDefinition AllowSubscriptionToClients = allowSubscriptionToClients; Providers = new List(); - Properties = new Dictionary(); + Properties = new Dictionary(); } public virtual NotificationDefinition WithProviders(params string[] providers) @@ -101,10 +101,10 @@ public class NotificationDefinition } public virtual NotificationDefinition WithTemplate( - Type localizationResource = null, + Type localizationResource, bool isLayout = false, - string layout = null, - string defaultCultureName = null) + string? layout = null, + string? defaultCultureName = null) { Template = new TemplateDefinition( Name, @@ -134,7 +134,7 @@ public class NotificationDefinition return this; } - public virtual NotificationDefinition WithTemplate(TemplateDefinition template) + public virtual NotificationDefinition WithTemplate(TemplateDefinition? template) { Template = template; diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs index 40f1f7841..2be1299eb 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs @@ -16,8 +16,8 @@ public class NotificationDefinitionContext : INotificationDefinitionContext public NotificationGroupDefinition AddGroup( [NotNull] string name, - ILocalizableString displayName = null, - ILocalizableString description = null, + ILocalizableString? displayName = null, + ILocalizableString? description = null, bool allowSubscriptionToClients = true) { Check.NotNull(name, nameof(name)); @@ -30,7 +30,7 @@ public class NotificationDefinitionContext : INotificationDefinitionContext return Groups[name] = new NotificationGroupDefinition(name, displayName, description, allowSubscriptionToClients); } - public NotificationGroupDefinition GetGroupOrNull(string name) + public NotificationGroupDefinition? GetGroupOrNull(string name) { Check.NotNull(name, nameof(name)); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs index 25b7f91c0..11f0a8b88 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs @@ -35,7 +35,7 @@ public class NotificationDefinitionManager : INotificationDefinitionManager, ITr return notification; } - public async virtual Task GetOrNullAsync(string name) + public async virtual Task GetOrNullAsync(string name) { Check.NotNull(name, nameof(name)); @@ -58,7 +58,7 @@ public class NotificationDefinitionManager : INotificationDefinitionManager, ITr }; } - public async virtual Task GetGroupOrNullAsync(string name) + public async virtual Task GetGroupOrNullAsync(string name) { Check.NotNull(name, nameof(name)); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEto.cs index c2615c23c..b310d2080 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEto.cs @@ -22,7 +22,7 @@ public class NotificationEto : RealTimeEto, IMultiTenant /// /// 通知名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 创建时间 /// diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEventData.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEventData.cs index b6ab48749..399ef7146 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEventData.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEventData.cs @@ -13,7 +13,7 @@ public class NotificationEventData : IMultiTenant /// /// 通知名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 用来标识一个应用程序 /// @@ -24,7 +24,7 @@ public class NotificationEventData : IMultiTenant /// /// 数据 /// - public NotificationData Data { get; set; } + public NotificationData Data { get; set; } = default!; /// /// 创建时间 /// diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs index 18fcfe906..39fc6a264 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs @@ -23,27 +23,27 @@ public class NotificationGroupDefinition get => _displayName; set => _displayName = Check.NotNull(value, nameof(value)); } - private ILocalizableString _displayName; + private ILocalizableString _displayName = default!; /// /// 通知组说明 /// [CanBeNull] - public ILocalizableString Description { get; set; } + public ILocalizableString? Description { get; set; } public bool AllowSubscriptionToClients { get; set; } public IReadOnlyList Notifications => _notifications.ToImmutableList(); private readonly List _notifications; - public Dictionary Properties { get; } + public Dictionary Properties { get; } - public object this[string name] { + public object? this[string name] { get => Properties.GetOrDefault(name); set => Properties[name] = value; } public static NotificationGroupDefinition Create( string name, - ILocalizableString displayName = null, - ILocalizableString description = null, + ILocalizableString? displayName = null, + ILocalizableString? description = null, bool allowSubscriptionToClients = false) { return new NotificationGroupDefinition(name, displayName, description, allowSubscriptionToClients); @@ -51,8 +51,8 @@ public class NotificationGroupDefinition protected internal NotificationGroupDefinition( string name, - ILocalizableString displayName = null, - ILocalizableString description = null, + ILocalizableString? displayName = null, + ILocalizableString? description = null, bool allowSubscriptionToClients = false) { Name = name; @@ -62,13 +62,13 @@ public class NotificationGroupDefinition _notifications = new List(); - Properties = new Dictionary(); + Properties = new Dictionary(); } public virtual NotificationDefinition AddNotification( string name, - ILocalizableString displayName = null, - ILocalizableString description = null, + ILocalizableString? displayName = null, + ILocalizableString? description = null, NotificationType notificationType = NotificationType.Application, NotificationLifetime lifetime = NotificationLifetime.Persistent, NotificationContentType contentType = NotificationContentType.Text, @@ -89,7 +89,7 @@ public class NotificationGroupDefinition return notification; } - public NotificationDefinition GetNotificationOrNull([NotNull] string name) + public NotificationDefinition? GetNotificationOrNull([NotNull] string name) { Check.NotNull(name, nameof(name)); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationInfo.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationInfo.cs index 86df68f40..540e52c9f 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationInfo.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationInfo.cs @@ -5,8 +5,8 @@ namespace LINGYUN.Abp.Notifications; public class NotificationInfo { public Guid? TenantId { get; set; } - public string Name { get; set; } - public string Id { get; set; } + public string Name { get; set; } = default!; + public string Id { get; set; } = default!; public NotificationData Data { get; set; } public DateTime CreationTime { get; set; } public NotificationLifetime Lifetime { get; set; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationPublishContext.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationPublishContext.cs index 0bbc2a293..dfd1a84e7 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationPublishContext.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationPublishContext.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; namespace LINGYUN.Abp.Notifications; -#nullable enable public class NotificationPublishContext { [NotNull] @@ -32,4 +31,3 @@ public class NotificationPublishContext Exception = exception; } } -#nullable disable diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSendInfo.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSendInfo.cs index 16dc10c33..8b58c2ca6 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSendInfo.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSendInfo.cs @@ -11,7 +11,7 @@ public class NotificationSendInfo public NotificationInfo NotificationInfo { get; } public IEnumerable Users { get; } public NotificationSendState State { get; private set; } - public string Reason { get; private set; } + public string? Reason { get; private set; } public NotificationSendInfo( [NotNull] string provider, DateTime sendTime, @@ -41,7 +41,7 @@ public class NotificationSendInfo State = NotificationSendState.Disabled; } - public void Sent(Exception exception = null) + public void Sent(Exception? exception = null) { State = exception != null ? NotificationSendState.Failed : NotificationSendState.Sent; Reason = exception?.Message; diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationStandardData.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationStandardData.cs index 12e3096fa..5410317ad 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationStandardData.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationStandardData.cs @@ -1,9 +1,9 @@ namespace LINGYUN.Abp.Notifications; public class NotificationStandardData { - public string Title { get; set; } - public string Message { get; set; } - public string Description { get; set; } + public string Title { get; set; } = default!; + public string Message { get; set; } = default!; + public string? Description { get; set; } public NotificationStandardData() { @@ -12,7 +12,7 @@ public class NotificationStandardData public NotificationStandardData( string title, string message, - string description = null) + string? description = null) { Title = title; Message = message; diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSubscriptionInfo.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSubscriptionInfo.cs index 9c9fbf425..7af307823 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSubscriptionInfo.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSubscriptionInfo.cs @@ -6,6 +6,6 @@ public class NotificationSubscriptionInfo { public Guid? TenantId { get; set; } public Guid UserId { get; set; } - public string UserName { get; set; } - public string NotificationName { get; set; } + public string UserName { get; set; } = default!; + public string NotificationName { get; set; } = default!; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationTemplate.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationTemplate.cs index 2f2df7440..631d86a72 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationTemplate.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationTemplate.cs @@ -13,10 +13,10 @@ namespace LINGYUN.Abp.Notifications; [EventName("notifications.template")] public class NotificationTemplate : IHasExtraProperties { - public string Name { get; set; } - public string Culture { get; set; } - public string FormUser { get; set; } - public object this[string key] + public string Name { get; set; } = default!; + public string? Culture { get; set; } + public string? FormUser { get; set; } + public object? this[string key] { get { return this.GetProperty(key); @@ -27,13 +27,16 @@ public class NotificationTemplate : IHasExtraProperties } public ExtraPropertyDictionary ExtraProperties { get; set; } - public NotificationTemplate() { } + public NotificationTemplate() + { + ExtraProperties = new ExtraPropertyDictionary(); + } public NotificationTemplate( string name, - string culture = null, - string formUser = null, - IDictionary data = null) + string? culture = null, + string? formUser = null, + IDictionary? data = null) { Name = Check.NotNullOrWhiteSpace(name, nameof(name)); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NullDynamicNotificationDefinitionStore.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NullDynamicNotificationDefinitionStore.cs index 06d9cc1c3..8515ef5fa 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NullDynamicNotificationDefinitionStore.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NullDynamicNotificationDefinitionStore.cs @@ -9,8 +9,8 @@ namespace LINGYUN.Abp.Notifications; [Dependency(TryRegister = true)] public class NullDynamicNotificationDefinitionStore : IDynamicNotificationDefinitionStore, ISingletonDependency { - private readonly static Task CachedNotificationResult = Task.FromResult((NotificationDefinition)null); - private readonly static Task CachedNotificationGroupResult = Task.FromResult((NotificationGroupDefinition)null); + private readonly static Task CachedNotificationResult = Task.FromResult(null); + private readonly static Task CachedNotificationGroupResult = Task.FromResult(null); private readonly static Task> CachedNotificationsResult = Task.FromResult((IReadOnlyList)Array.Empty().ToImmutableList()); @@ -18,7 +18,7 @@ public class NullDynamicNotificationDefinitionStore : IDynamicNotificationDefini private readonly static Task> CachedGroupsResult = Task.FromResult((IReadOnlyList)Array.Empty().ToImmutableList()); - public Task GetOrNullAsync(string name) + public Task GetOrNullAsync(string name) { return CachedNotificationResult; } @@ -28,7 +28,7 @@ public class NullDynamicNotificationDefinitionStore : IDynamicNotificationDefini return CachedNotificationsResult; } - public Task GetGroupOrNullAsync(string name) + public Task GetGroupOrNullAsync(string name) { return CachedNotificationGroupResult; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/StaticNotificationDefinitionStore.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/StaticNotificationDefinitionStore.cs index de6b803f3..17614b4bc 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/StaticNotificationDefinitionStore.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/StaticNotificationDefinitionStore.cs @@ -73,14 +73,14 @@ public class StaticNotificationDefinitionStore : IStaticNotificationDefinitionSt foreach (var provider in providers) { - provider.Define(context); + provider?.Define(context); } } return context.Groups; } - public virtual Task GetOrNullAsync(string name) + public virtual Task GetOrNullAsync(string name) { return Task.FromResult(NotificationDefinitions.GetOrDefault(name)); } @@ -92,7 +92,7 @@ public class StaticNotificationDefinitionStore : IStaticNotificationDefinitionSt ); } - public virtual Task GetGroupOrNullAsync(string name) + public virtual Task GetGroupOrNullAsync(string name) { return Task.FromResult(NotificationGroupDefinitions.GetOrDefault(name)); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/UserIdentifier.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/UserIdentifier.cs index dda4b9a92..c4d3c1f74 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/UserIdentifier.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/UserIdentifier.cs @@ -14,14 +14,14 @@ public class UserIdentifier /// /// 用户名 /// - public string UserName { get; set; } + public string? UserName { get; set; } public UserIdentifier() { } - public UserIdentifier(Guid userId, string userName) + public UserIdentifier(Guid userId, string? userName) { UserId = userId; UserName = userName; diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDbProperties.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDbProperties.cs index b93beb280..100cc1ae0 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDbProperties.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDbProperties.cs @@ -4,7 +4,7 @@ public class AbpNotificationsDbProperties { public const string DefaultTablePrefix = "App"; - public const string DefaultSchema = null; + public const string? DefaultSchema = null; public const string ConnectionStringName = "Notifications"; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainMappers.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainMappers.cs index d4cc272e1..fc1503512 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainMappers.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainMappers.cs @@ -25,7 +25,7 @@ public partial class NotificationToNotificationInfoMapper : MapperBase NotificationGroupDefinitions { get; } protected IDictionary NotificationDefinitions { get; } @@ -47,7 +47,7 @@ public class DynamicNotificationDefinitionInMemoryCache : IDynamicNotificationDe foreach (var notificationGroupRecord in notificationGroupRecords) { - ILocalizableString description = null; + ILocalizableString? description = null; if (!notificationGroupRecord.Description.IsNullOrWhiteSpace()) { description = LocalizableStringSerializer.Deserialize(notificationGroupRecord.Description); @@ -78,7 +78,7 @@ public class DynamicNotificationDefinitionInMemoryCache : IDynamicNotificationDe return Task.CompletedTask; } - public virtual NotificationDefinition GetNotificationOrNull(string name) + public virtual NotificationDefinition? GetNotificationOrNull(string name) { return NotificationDefinitions.GetOrDefault(name); } @@ -88,7 +88,7 @@ public class DynamicNotificationDefinitionInMemoryCache : IDynamicNotificationDe return NotificationDefinitions.Values.ToList(); } - public virtual NotificationGroupDefinition GetNotificationGroupOrNull(string name) + public virtual NotificationGroupDefinition? GetNotificationGroupOrNull(string name) { return NotificationGroupDefinitions.GetOrDefault(name); } @@ -102,7 +102,12 @@ public class DynamicNotificationDefinitionInMemoryCache : IDynamicNotificationDe NotificationGroupDefinition notificationGroup, NotificationDefinitionRecord notificationRecord) { - ILocalizableString description = null; + ILocalizableString? displayName = null; + if (!notificationRecord.DisplayName.IsNullOrWhiteSpace()) + { + displayName = LocalizableStringSerializer.Deserialize(notificationRecord.DisplayName); + } + ILocalizableString? description = null; if (!notificationRecord.Description.IsNullOrWhiteSpace()) { description = LocalizableStringSerializer.Deserialize(notificationRecord.Description); @@ -110,7 +115,7 @@ public class DynamicNotificationDefinitionInMemoryCache : IDynamicNotificationDe var notification = notificationGroup.AddNotification( notificationRecord.Name, - LocalizableStringSerializer.Deserialize(notificationRecord.DisplayName), + displayName, description, notificationRecord.NotificationType, notificationRecord.NotificationLifetime, diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionStore.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionStore.cs index 1f6207f66..46d6fe1c8 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionStore.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionStore.cs @@ -44,7 +44,7 @@ public class DynamicNotificationDefinitionStore : IDynamicNotificationDefinition CacheOptions = cacheOptions.Value; } - public async virtual Task GetOrNullAsync(string name) + public async virtual Task GetOrNullAsync(string name) { if (!NotificationManagementOptions.IsDynamicNotificationsStoreEnabled) { @@ -72,7 +72,7 @@ public class DynamicNotificationDefinitionStore : IDynamicNotificationDefinition } } - public async virtual Task GetGroupOrNullAsync(string name) + public async virtual Task GetGroupOrNullAsync(string name) { if (!NotificationManagementOptions.IsDynamicNotificationsStoreEnabled) { diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IDynamicNotificationDefinitionStoreCache.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IDynamicNotificationDefinitionStoreCache.cs index 1ecea9253..a0d8b55fd 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IDynamicNotificationDefinitionStoreCache.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IDynamicNotificationDefinitionStoreCache.cs @@ -7,7 +7,7 @@ namespace LINGYUN.Abp.Notifications; public interface IDynamicNotificationDefinitionStoreCache { - string CacheStamp { get; set; } + string? CacheStamp { get; set; } SemaphoreSlim SyncSemaphore { get; } @@ -17,11 +17,11 @@ public interface IDynamicNotificationDefinitionStoreCache List webhookGroupRecords, List webhookRecords); - NotificationDefinition GetNotificationOrNull(string name); + NotificationDefinition? GetNotificationOrNull(string name); IReadOnlyList GetNotifications(); - NotificationGroupDefinition GetNotificationGroupOrNull(string name); + NotificationGroupDefinition? GetNotificationGroupOrNull(string name); IReadOnlyList GetGroups(); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionGroupRecordRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionGroupRecordRepository.cs index 411b3d657..6752889ba 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionGroupRecordRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionGroupRecordRepository.cs @@ -9,7 +9,7 @@ namespace LINGYUN.Abp.Notifications; public interface INotificationDefinitionGroupRecordRepository : IBasicRepository { - Task FindByNameAsync( + Task FindByNameAsync( string name, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionRecordRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionRecordRepository.cs index 1d5b669b7..886af2036 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionRecordRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionRecordRepository.cs @@ -9,7 +9,7 @@ namespace LINGYUN.Abp.Notifications; public interface INotificationDefinitionRecordRepository : IBasicRepository { - Task FindByNameAsync( + Task FindByNameAsync( string name, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionSerializer.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionSerializer.cs index fe94255dd..7ae7df6b7 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionSerializer.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationDefinitionSerializer.cs @@ -7,12 +7,12 @@ namespace LINGYUN.Abp.Notifications; public interface INotificationDefinitionSerializer { Task<(NotificationDefinitionGroupRecord[], NotificationDefinitionRecord[])> - SerializeAsync(IEnumerable NotificationGroups); + SerializeAsync(IEnumerable notificationGroups); Task SerializeAsync( - NotificationGroupDefinition NotificationGroup); + NotificationGroupDefinition notificationGroup); Task SerializeAsync( - NotificationDefinition Notification, - [CanBeNull] NotificationGroupDefinition NotificationGroup); + NotificationDefinition notification, + NotificationGroupDefinition notificationGroup); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationSendRecordRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationSendRecordRepository.cs index c239bdc99..033239a52 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationSendRecordRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationSendRecordRepository.cs @@ -13,7 +13,7 @@ public interface INotificationSendRecordRepository : IBasicRepository> GetListAsync( ISpecification specification, - string sorting = $"{nameof(NotificationSendRecordInfo.SendTime)} DESC", + string? sorting = $"{nameof(NotificationSendRecordInfo.SendTime)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserNotificationRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserNotificationRepository.cs index 80a2994f7..d3f6778c6 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserNotificationRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserNotificationRepository.cs @@ -36,14 +36,14 @@ public interface IUserNotificationRepository : IBasicRepository GetCountAsync( Guid userId, - string filter = "", + string? filter = null, NotificationReadState? readState = null, CancellationToken cancellationToken = default); Task> GetListAsync( Guid userId, - string filter = "", - string sorting = nameof(Notification.CreationTime), + string? filter = null, + string? sorting = nameof(Notification.CreationTime), NotificationReadState? readState = null, int skipCount = 0, int maxResultCount = 10, @@ -57,7 +57,7 @@ public interface IUserNotificationRepository : IBasicRepository> GetListAsync( Guid userId, ISpecification specification, - string sorting = nameof(Notification.CreationTime), + string? sorting = nameof(Notification.CreationTime), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserSubscribeRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserSubscribeRepository.cs index 8063b179c..b88af82ae 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserSubscribeRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserSubscribeRepository.cs @@ -13,14 +13,14 @@ public interface IUserSubscribeRepository : IBasicRepository GetUserSubscribeAsync( + Task GetUserSubscribeAsync( string notificationName, Guid userId, CancellationToken cancellationToken = default); Task> GetUserSubscribesAsync( string notificationName, - IEnumerable userIds = null, + IEnumerable? userIds = null, CancellationToken cancellationToken = default); Task> GetUserSubscribesAsync( @@ -54,7 +54,7 @@ public interface IUserSubscribeRepository : IBasicRepository> GetUserSubscribesAsync( Guid userId, - string sorting = nameof(UserSubscribe.Id), + string? sorting = nameof(UserSubscribe.Id), int skipCount = 1, int maxResultCount = 10, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Notification.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Notification.cs index 3d8b6b6ba..3a531f31e 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Notification.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Notification.cs @@ -13,8 +13,8 @@ public class Notification : Entity, IMultiTenant, IHasCreationTime, IHasEx public virtual NotificationType Type { get; set; } public virtual NotificationContentType ContentType { get; set; } public virtual long NotificationId { get; protected set; } - public virtual string NotificationName { get; protected set; } - public virtual string NotificationTypeName { get; protected set; } + public virtual string NotificationName { get; protected set; } = default!; + public virtual string NotificationTypeName { get; protected set; } = default!; public virtual DateTime? ExpirationTime { get; set; } public virtual DateTime CreationTime { get; set; } public virtual ExtraPropertyDictionary ExtraProperties { get; protected set; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecord.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecord.cs index 9f82b451c..e52d12474 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecord.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecord.cs @@ -10,21 +10,21 @@ public class NotificationDefinitionGroupRecord : BasicAggregateRoot, IHasE /// /// 分组名称 /// - public virtual string Name { get; set; } + public virtual string Name { get; set; } = default!; /// /// 显示名称 /// /// /// 如果为空,回退到Name /// - public virtual string DisplayName { get; set; } + public virtual string? DisplayName { get; set; } /// /// 描述 /// /// /// 如果为空,回退到Name /// - public virtual string Description { get; set; } + public virtual string? Description { get; set; } /// /// 允许客户端订阅 /// @@ -41,8 +41,8 @@ public class NotificationDefinitionGroupRecord : BasicAggregateRoot, IHasE public NotificationDefinitionGroupRecord( Guid id, string name, - string displayName = null, - string description = null) + string? displayName = null, + string? description = null) : base(id) { Name = Check.NotNullOrWhiteSpace(name, nameof(name), NotificationDefinitionGroupRecordConsts.MaxNameLength); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupsCacheItem.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupsCacheItem.cs index f58cd55b9..797019cf6 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupsCacheItem.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupsCacheItem.cs @@ -30,9 +30,9 @@ public class NotificationDefinitionGroupsCacheItem public class NotificationDefinitionGroupCacheItem { - public string Name { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } + public string Name { get; set; } = default!; + public string? DisplayName { get; set; } + public string? Description { get; set; } public bool AllowSubscriptionToClients { get; set; } public NotificationDefinitionGroupCacheItem() { @@ -41,8 +41,8 @@ public class NotificationDefinitionGroupCacheItem public NotificationDefinitionGroupCacheItem( string name, - string displayName = null, - string description = null, + string? displayName = null, + string? description = null, bool allowSubscriptionToClients = false) { Name = name; diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionRecord.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionRecord.cs index 30a76e9b2..0a5dd6809 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionRecord.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionRecord.cs @@ -12,29 +12,29 @@ public class NotificationDefinitionRecord : BasicAggregateRoot, IHasExtraP /// /// 名称 /// - public virtual string Name { get; set; } + public virtual string Name { get; set; } = default!; /// /// 分组名称 /// - public virtual string GroupName { get; set; } + public virtual string GroupName { get; set; } = default!; /// /// 显示名称 /// /// /// 如果为空,回退到Name /// - public virtual string DisplayName { get; set; } + public virtual string? DisplayName { get; set; } /// /// 描述 /// /// /// 如果为空,回退到Name /// - public virtual string Description { get; set; } + public virtual string? Description { get; set; } /// /// 通知模板 /// - public virtual string Template { get; set; } + public virtual string? Template { get; set; } /// /// 存活类型 /// @@ -53,7 +53,7 @@ public class NotificationDefinitionRecord : BasicAggregateRoot, IHasExtraP /// /// 多个之间用;分隔 /// - public virtual string Providers { get; set; } + public virtual string? Providers { get; set; } /// /// 允许客户端订阅 /// @@ -70,9 +70,9 @@ public class NotificationDefinitionRecord : BasicAggregateRoot, IHasExtraP Guid id, string name, string groupName, - string displayName = null, - string description = null, - string template = null, + string? displayName = null, + string? description = null, + string? template = null, NotificationLifetime lifetime = NotificationLifetime.Persistent, NotificationType notificationType = NotificationType.Application, NotificationContentType contentType = NotificationContentType.Text) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionSerializer.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionSerializer.cs index 877388eab..1ff3f6455 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionSerializer.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionSerializer.cs @@ -66,16 +66,21 @@ public class NotificationDefinitionSerializer : INotificationDefinitionSerialize public virtual Task SerializeAsync( NotificationDefinition notification, - [CanBeNull] NotificationGroupDefinition notificationGroup) + NotificationGroupDefinition notificationGroup) { using (CultureHelper.Use(CultureInfo.InvariantCulture)) { + string? description = null; + if (notification.Description != null) + { + description = LocalizableStringSerializer.Serialize(notification.Description); + } var notificationRecord = new NotificationDefinitionRecord( GuidGenerator.Create(), notification.Name, - notificationGroup?.Name, + notificationGroup.Name, LocalizableStringSerializer.Serialize(notification.DisplayName), - LocalizableStringSerializer.Serialize(notification.Description), + description, notification.Template?.Name, notification.NotificationLifetime, notification.NotificationType, @@ -91,7 +96,7 @@ public class NotificationDefinitionSerializer : INotificationDefinitionSerialize } } - protected virtual string SerializeProviders(ICollection providers) + protected virtual string? SerializeProviders(ICollection providers) { return providers.Any() ? providers.JoinAsString(",") diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionsCacheItem.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionsCacheItem.cs index fdf0a5c04..43e203915 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionsCacheItem.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionsCacheItem.cs @@ -31,10 +31,10 @@ public class NotificationDefinitionsCacheItem public class NotificationDefinitionCacheItem { - public string Name { get; set; } - public string GroupName { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } + public string Name { get; set; } = default!; + public string GroupName { get; set; } = default!; + public string? DisplayName { get; set; } + public string? Description { get; set; } public NotificationLifetime Lifetime { get; set; } public NotificationType NotificationType { get; set; } public NotificationContentType ContentType { get; set; } @@ -50,12 +50,12 @@ public class NotificationDefinitionCacheItem public NotificationDefinitionCacheItem( string name, string groupName, - string displayName = null, - string description = null, + string? displayName = null, + string? description = null, NotificationLifetime lifetime = NotificationLifetime.Persistent, NotificationType notificationType = NotificationType.Application, NotificationContentType contentType = NotificationContentType.Text, - List providers = null, + List? providers = null, bool allowSubscriptionToClients = false) { Name = name; diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationSendRecord.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationSendRecord.cs index 947bbd0c1..604fdc66c 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationSendRecord.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationSendRecord.cs @@ -7,14 +7,14 @@ namespace LINGYUN.Abp.Notifications; public class NotificationSendRecord : Entity, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - public virtual string Provider { get; protected set; } + public virtual string Provider { get; protected set; } = default!; public virtual DateTime SendTime { get; protected set; } public virtual Guid UserId { get; protected set; } - public virtual string UserName { get; protected set; } + public virtual string UserName { get; protected set; } = default!; public virtual long NotificationId { get; protected set; } - public virtual string NotificationName { get; protected set; } + public virtual string NotificationName { get; protected set; } = default!; public virtual NotificationSendState State { get; protected set; } - public virtual string Reason { get; protected set; } + public virtual string? Reason { get; protected set; } protected NotificationSendRecord() { } @@ -23,17 +23,17 @@ public class NotificationSendRecord : Entity, IMultiTenant string provider, DateTime sendTime, Guid userId, - string userName, + string? userName, long notificationId, string notificationName, NotificationSendState state, - string reason = null, + string? reason = null, Guid? tenantId = null) { Provider = Check.NotNullOrWhiteSpace(provider, nameof(provider), NotificationSendRecordConsts.MaxProviderLength); SendTime = sendTime; UserId = userId; - UserName = Check.Length(userName, nameof(userName), SubscribeConsts.MaxUserNameLength); + UserName = Check.Length(userName, nameof(userName), SubscribeConsts.MaxUserNameLength) ?? "/"; NotificationId = notificationId; NotificationName = Check.NotNullOrWhiteSpace(notificationName, nameof(notificationName), NotificationConsts.MaxNameLength); State = state; diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationSendRecordInfo.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationSendRecordInfo.cs index 44543fdd5..9fecaf2ea 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationSendRecordInfo.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationSendRecordInfo.cs @@ -4,11 +4,11 @@ namespace LINGYUN.Abp.Notifications; public class NotificationSendRecordInfo { public long Id { get; set; } - public string Provider { get; set; } + public string Provider { get; set; } = default!; public DateTime SendTime { get; set; } public Guid UserId { get; set; } - public string UserName { get; set; } + public string UserName { get; set; } = default!; public NotificationSendState State { get; set; } - public string Reason { get; set; } - public UserNotificationInfo NotificationInfo { get; set; } + public string? Reason { get; set; } + public UserNotificationInfo NotificationInfo { get; set; } = default!; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationStore.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationStore.cs index d4b6b59f2..087c619cf 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationStore.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationStore.cs @@ -201,8 +201,11 @@ public class NotificationStore : INotificationStore { var userSubscribe = await _userSubscribeRepository .GetUserSubscribeAsync(notificationName, userId, cancellationToken); - await _userSubscribeRepository - .DeleteAsync(userSubscribe.Id, cancellationToken: cancellationToken); + if (userSubscribe != null) + { + await _userSubscribeRepository + .DeleteAsync(userSubscribe.Id, cancellationToken: cancellationToken); + } await unitOfWork.CompleteAsync(cancellationToken); } @@ -241,7 +244,7 @@ public class NotificationStore : INotificationStore public async virtual Task> GetUserSubscriptionsAsync( Guid? tenantId, string notificationName, - IEnumerable identifiers = null, + IEnumerable? identifiers = null, CancellationToken cancellationToken = default) { using (_currentTenant.Change(tenantId)) @@ -361,7 +364,7 @@ public class NotificationStore : INotificationStore var notify = new Notification( notification.GetId(), notification.Name, - notification.Data.GetType().AssemblyQualifiedName, + notification.Data.GetType().AssemblyQualifiedName!, notification.Data, notification.Severity, notification.TenantId) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Subscribe.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Subscribe.cs index c376d24cc..0e14e49ac 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Subscribe.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Subscribe.cs @@ -9,7 +9,7 @@ public abstract class Subscribe : Entity, IMultiTenant, IHasCreationTime { public virtual Guid? TenantId { get; protected set; } public virtual DateTime CreationTime { get; set; } - public virtual string NotificationName { get; protected set; } + public virtual string NotificationName { get; protected set; } = default!; protected Subscribe() { } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserNotificationInfo.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserNotificationInfo.cs index b62312895..0ee3dad4b 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserNotificationInfo.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserNotificationInfo.cs @@ -6,11 +6,11 @@ namespace LINGYUN.Abp.Notifications; public class UserNotificationInfo { public Guid? TenantId { get; set; } - public string Name { get; set; } + public string Name { get; set; } = default!; public long Id { get; set; } public long NotificationId { get; set; } - public ExtraPropertyDictionary ExtraProperties { get; set; } - public string NotificationTypeName { get; set; } + public ExtraPropertyDictionary ExtraProperties { get; set; } = default!; + public string NotificationTypeName { get; set; } = default!; public DateTime CreationTime { get; set; } public NotificationType Type { get; set; } public NotificationContentType ContentType { get; set; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserSubscribe.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserSubscribe.cs index 0ca9aa2fa..68e9830c4 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserSubscribe.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserSubscribe.cs @@ -6,12 +6,12 @@ namespace LINGYUN.Abp.Notifications; public class UserSubscribe : Subscribe, IHasCreationTime { public virtual Guid UserId { get; set; } - public virtual string UserName { get; set; } + public virtual string UserName { get; set; } = default!; protected UserSubscribe() { } - public UserSubscribe(string notificationName, Guid userId, string userName, Guid? tenantId = null) + public UserSubscribe(string notificationName, Guid userId, string? userName, Guid? tenantId = null) : base(notificationName, tenantId) { UserId = userId; - UserName = userName; + UserName = userName ?? "/"; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsModelBuilderConfigurationOptions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsModelBuilderConfigurationOptions.cs index 2c090bd3c..a9f9380c5 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsModelBuilderConfigurationOptions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsModelBuilderConfigurationOptions.cs @@ -7,7 +7,7 @@ public class AbpNotificationsModelBuilderConfigurationOptions : AbpModelBuilderC { public AbpNotificationsModelBuilderConfigurationOptions( [NotNull] string tablePrefix = AbpNotificationsDbProperties.DefaultTablePrefix, - [CanBeNull] string schema = AbpNotificationsDbProperties.DefaultSchema) + [CanBeNull] string? schema = AbpNotificationsDbProperties.DefaultSchema) : base( tablePrefix, schema) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationDefinitionGroupRecordRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationDefinitionGroupRecordRepository.cs index 887931f2b..4f71ec346 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationDefinitionGroupRecordRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationDefinitionGroupRecordRepository.cs @@ -23,7 +23,7 @@ public class EfCoreNotificationDefinitionGroupRecordRepository : { } - public async virtual Task FindByNameAsync( + public async virtual Task FindByNameAsync( string name, CancellationToken cancellationToken = default) { diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationDefinitionRecordRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationDefinitionRecordRepository.cs index 5168874cd..3683fe29e 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationDefinitionRecordRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationDefinitionRecordRepository.cs @@ -23,7 +23,7 @@ public class EfCoreNotificationDefinitionRecordRepository : { } - public async virtual Task FindByNameAsync( + public async virtual Task FindByNameAsync( string name, CancellationToken cancellationToken = default) { diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationRepository.cs index 4a0c1adfc..13b56f593 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationRepository.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -36,6 +37,7 @@ public class EfCoreNotificationRepository : EfCoreRepository x.NotificationId.Equals(notificationId)) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)) + ?? throw new EntityNotFoundException(typeof(Notification), notificationId); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationSendRecordRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationSendRecordRepository.cs index 0977dc942..f3bfe315b 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationSendRecordRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreNotificationSendRecordRepository.cs @@ -31,7 +31,7 @@ public class EfCoreNotificationSendRecordRepository : public async virtual Task> GetListAsync( ISpecification specification, - string sorting = $"{nameof(NotificationSendRecordInfo.SendTime)} DESC", + string? sorting = $"{nameof(NotificationSendRecordInfo.SendTime)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserNotificationRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserNotificationRepository.cs index 651de3ce7..93452f0ab 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserNotificationRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserNotificationRepository.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Tasks; using System.Xml; using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Specifications; @@ -64,7 +65,8 @@ public class EfCoreUserNotificationRepository : EfCoreRepository> GetListAsync( @@ -95,7 +97,7 @@ public class EfCoreUserNotificationRepository : EfCoreRepository() .Where(x => x.UserId == userId) - .WhereIf(readState.HasValue, x => x.ReadStatus == readState.Value); + .WhereIf(readState.HasValue, x => x.ReadStatus == readState); var notifilerQuery = from un in userNotifilerQuery join n in dbContext.Set() @@ -123,7 +125,7 @@ public class EfCoreUserNotificationRepository : EfCoreRepository GetCountAsync( Guid userId, - string filter = "", + string? filter = null, NotificationReadState? readState = null, CancellationToken cancellationToken = default) { @@ -147,10 +149,10 @@ public class EfCoreUserNotificationRepository : EfCoreRepository x.State == readState.Value) + .WhereIf(readState.HasValue, x => x.State == readState) .WhereIf(!filter.IsNullOrWhiteSpace(), nf => - nf.Name.Contains(filter) || - nf.NotificationTypeName.Contains(filter)) + nf.Name.Contains(filter!) || + nf.NotificationTypeName.Contains(filter!)) .CountAsync(GetCancellationToken(cancellationToken)); } @@ -185,8 +187,8 @@ public class EfCoreUserNotificationRepository : EfCoreRepository> GetListAsync( Guid userId, - string filter = "", - string sorting = nameof(Notification.CreationTime), + string? filter = null, + string? sorting = nameof(Notification.CreationTime), NotificationReadState? readState = null, int skipCount = 1, int maxResultCount = 10, @@ -217,10 +219,10 @@ public class EfCoreUserNotificationRepository : EfCoreRepository x.State == readState.Value) + .WhereIf(readState.HasValue, x => x.State == readState) .WhereIf(!filter.IsNullOrWhiteSpace(), nf => - nf.Name.Contains(filter) || - nf.NotificationTypeName.Contains(filter)) + nf.Name.Contains(filter!) || + nf.NotificationTypeName.Contains(filter!)) .OrderBy(sorting) .PageBy(skipCount, maxResultCount) .AsNoTracking() @@ -230,7 +232,7 @@ public class EfCoreUserNotificationRepository : EfCoreRepository> GetListAsync( Guid userId, ISpecification specification, - string sorting = nameof(Notification.CreationTime), + string? sorting = nameof(Notification.CreationTime), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserSubscribeRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserSubscribeRepository.cs index 5fe29f548..078d00cbb 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserSubscribeRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserSubscribeRepository.cs @@ -22,69 +22,59 @@ public class EfCoreUserSubscribeRepository : EfCoreRepository> GetUserSubscribesAsync( string notificationName, - IEnumerable userIds = null, + IEnumerable? userIds = null, CancellationToken cancellationToken = default) { - var userSubscribes = await (await GetDbSetAsync()) + return await (await GetDbSetAsync()) .Distinct() .Where(x => x.NotificationName.Equals(notificationName)) - .WhereIf(userIds?.Any() == true, x => userIds.Contains(x.UserId)) + .WhereIf(userIds?.Count() > 0, x => userIds!.Contains(x.UserId)) .AsNoTracking() .ToListAsync(GetCancellationToken(cancellationToken)); - - return userSubscribes; } - public async virtual Task GetUserSubscribeAsync( + public async virtual Task GetUserSubscribeAsync( string notificationName, Guid userId, CancellationToken cancellationToken = default) { - var userSubscribe = await (await GetDbSetAsync()) + return await (await GetDbSetAsync()) .Where(x => x.UserId.Equals(userId) && x.NotificationName.Equals(notificationName)) .AsNoTracking() .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - - return userSubscribe; } public async virtual Task> GetUserSubscribesAsync( Guid userId, CancellationToken cancellationToken = default) { - var userSubscribeNames = await (await GetDbSetAsync()) + return await (await GetDbSetAsync()) .Distinct() .Where(x => x.UserId.Equals(userId)) .Select(x => x.NotificationName) .ToListAsync(GetCancellationToken(cancellationToken)); - - return userSubscribeNames; } public async virtual Task> GetUserSubscribesByNameAsync( string userName, CancellationToken cancellationToken = default) { - var userSubscribeNames = await (await GetDbSetAsync()) + return await (await GetDbSetAsync()) .Distinct() .Where(x => x.UserName.Equals(userName)) .AsNoTracking() .ToListAsync(GetCancellationToken(cancellationToken)); - - return userSubscribeNames; } public async virtual Task> GetUserSubscribesAsync( string notificationName, CancellationToken cancellationToken = default) { - var subscribeUsers = await (await GetDbSetAsync()) + return await (await GetDbSetAsync()) .Distinct() .Where(x => x.NotificationName.Equals(notificationName)) .Select(x => x.UserId) .ToListAsync(GetCancellationToken(cancellationToken)); - - return subscribeUsers; } public async virtual Task InsertUserSubscriptionAsync( @@ -132,7 +122,7 @@ public class EfCoreUserSubscribeRepository : EfCoreRepository> GetUserSubscribesAsync( Guid userId, - string sorting = "Id", + string? sorting = nameof(UserSubscribe.Id), int skipCount = 1, int maxResultCount = 10, CancellationToken cancellationToken = default) @@ -141,26 +131,22 @@ public class EfCoreUserSubscribeRepository : EfCoreRepository x.UserId.Equals(userId)) .OrderBy(sorting) .Page(skipCount, maxResultCount) .AsNoTracking() .ToListAsync(GetCancellationToken(cancellationToken)); - - return userSubscribes; } public async virtual Task GetCountAsync( Guid userId, CancellationToken cancellationToken = default) { - var userSubscribedCount = await (await GetDbSetAsync()) + return await (await GetDbSetAsync()) .Distinct() .Where(x => x.UserId.Equals(userId)) .LongCountAsync(GetCancellationToken(cancellationToken)); - - return userSubscribedCount; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs index c1a350e27..eaa9e5917 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs @@ -9,7 +9,7 @@ public static class NotificationsDbContextModelCreatingExtensions { public static void ConfigureNotifications( this ModelBuilder builder, - Action optionsAction = null) + Action? optionsAction = null) { Check.NotNull(builder, nameof(builder)); @@ -82,7 +82,7 @@ public static class NotificationsDbContextModelCreatingExtensions public static void ConfigureNotificationsDefinition( this ModelBuilder builder, - Action optionsAction = null) + Action? optionsAction = null) { Check.NotNull(builder, nameof(builder)); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN/Abp/Notifications/NotificationDataExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN/Abp/Notifications/NotificationDataExtensions.cs index 7e472be63..82ce0eecd 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN/Abp/Notifications/NotificationDataExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN/Abp/Notifications/NotificationDataExtensions.cs @@ -12,7 +12,7 @@ public static class NotificationDataExtensions notificationData.TrySetData(WebhookKey, url); } - public static string GetWebhookOrNull( + public static string? GetWebhookOrNull( this NotificationData notificationData) { return notificationData.TryGetData(WebhookKey)?.ToString(); @@ -25,7 +25,7 @@ public static class NotificationDataExtensions notificationData.TrySetData(CallbackUrlKey, callbackUrl); } - public static string GetCallbackUrlOrNull( + public static string? GetCallbackUrlOrNull( this NotificationData notificationData) { return notificationData.TryGetData(CallbackUrlKey)?.ToString(); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN/Abp/Notifications/NotificationDefinitionExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN/Abp/Notifications/NotificationDefinitionExtensions.cs index f8cad1299..94c7e5127 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN/Abp/Notifications/NotificationDefinitionExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN/Abp/Notifications/NotificationDefinitionExtensions.cs @@ -97,12 +97,12 @@ public static class NotificationDefinitionExtensions /// /// 通知定义的群组编码,未定义返回null /// - public static string GetTopicOrNull( + public static string? GetTopicOrNull( this NotificationDefinition notification) { if (notification.Properties.TryGetValue(TopicKey, out var topicDefine) == true) { - return topicDefine.ToString(); + return topicDefine?.ToString(); } return null; diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs index 8c109c935..0b821ab39 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs @@ -30,7 +30,7 @@ public class NotificationsHub : AbpHub } } - public override async Task OnDisconnectedAsync(Exception exception) + public override async Task OnDisconnectedAsync(Exception? exception) { await base.OnDisconnectedAsync(exception); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationSender.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationSender.cs index 4ec8ed79e..4a77f29c4 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationSender.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationSender.cs @@ -40,8 +40,14 @@ public class SmsNotificationSender : ISmsNotificationSender, ITransientDependenc // TODO: 后期增强功能,增加短信模板、通知模板功能 message.Properties.Add("TemplateCode", templateCode); - message.Properties.Add("SignName", notification.Data.TryGetData("SignName")); - message.Properties.AddIfNotContains(notification.Data.ExtraProperties); + message.Properties.Add("SignName", notification.Data.TryGetData("SignName")!); + foreach (var prop in notification.Data.ExtraProperties) + { + if (prop.Value != null) + { + message.Properties[prop.Key] = prop.Value; + } + } await SmsSender.SendAsync(message); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/INotificationTemplateResolveContext.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/INotificationTemplateResolveContext.cs index 723f8a46c..f821351cb 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/INotificationTemplateResolveContext.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/INotificationTemplateResolveContext.cs @@ -5,7 +5,7 @@ public interface INotificationTemplateResolveContext : IServiceProviderAccessor { NotificationTemplate Template { get; } - object Model { get; set; } + object? Model { get; set; } bool Handled { get; set; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/NotificationTemplateResolveContext.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/NotificationTemplateResolveContext.cs index 1de28038b..a214d2359 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/NotificationTemplateResolveContext.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/NotificationTemplateResolveContext.cs @@ -7,7 +7,7 @@ public class NotificationTemplateResolveContext : INotificationTemplateResolveCo public NotificationTemplate Template { get; } - public object Model { get; set; } + public object? Model { get; set; } public bool Handled { get; set; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/NotificationTemplateResolveResult.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/NotificationTemplateResolveResult.cs index c1cd21968..e57a66f2d 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/NotificationTemplateResolveResult.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN/Abp/Notifications/Templating/NotificationTemplateResolveResult.cs @@ -6,7 +6,7 @@ public class NotificationTemplateResolveResult /// /// 模板数据 /// - public object Model { get; set; } + public object? Model { get; set; } public List AppliedResolvers { get; } public NotificationTemplateResolveResult() diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramOptions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramOptions.cs index e663f1e91..af50a0b83 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramOptions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramOptions.cs @@ -8,7 +8,7 @@ public class AbpNotificationsWeChatMiniProgramOptions /// /// 默认小程序模板 /// - public string DefaultTemplateId { get; set; } + public string DefaultTemplateId { get; set; } = default!; /// /// 默认跳转小程序类型 /// diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/WeChatMiniProgramNotificationPublishProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/WeChatMiniProgramNotificationPublishProvider.cs index fc150a76a..3bbbefc6d 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/WeChatMiniProgramNotificationPublishProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/WeChatMiniProgramNotificationPublishProvider.cs @@ -58,7 +58,7 @@ public class WeChatMiniProgramNotificationPublishProvider : NotificationPublishP Logger.LogDebug($"Get wechat weapp template id: {templateId}"); - var redirect = GetOrDefault(context.Notification.Data, "RedirectPage", null); + var redirect = GetOrDefault(context.Notification.Data, "RedirectPage", ""); Logger.LogDebug($"Get wechat weapp redirect page: {redirect ?? "null"}"); var weAppState = GetOrDefault(context.Notification.Data, "WeAppState", Options.Value.DefaultState); @@ -75,12 +75,17 @@ public class WeChatMiniProgramNotificationPublishProvider : NotificationPublishP // 发送小程序订阅消息 await SubscribeMessager .SendAsync( - identifier.UserId, templateId, redirect, weAppLang, - weAppState, context.Notification.Data.ExtraProperties, cancellationToken); + identifier.UserId, + templateId, + redirect, + weAppLang, + weAppState, + context.Notification.Data.ExtraProperties, + cancellationToken); } else { - var weChatWeAppNotificationData = new SubscribeMessage(templateId, redirect, weAppState, weAppLang); + var weChatWeAppNotificationData = new SubscribeMessage(openId, templateId, redirect, weAppState, weAppLang); // 写入模板数据 weChatWeAppNotificationData.WriteData(context.Notification.Data.ExtraProperties); @@ -101,11 +106,11 @@ public class WeChatMiniProgramNotificationPublishProvider : NotificationPublishP protected string GetOrDefault(NotificationData data, string key, string defaultValue) { - if (data.ExtraProperties.TryGetValue(key, out var value)) + if (data.ExtraProperties.TryGetValue(key, out var value) && value != null) { // 取得了数据就删除对应键值 // data.Properties.Remove(key); - return value.ToString(); + return value.ToString()!; } return defaultValue; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/NotificationDataWeChatWorkExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/NotificationDataWeChatWorkExtensions.cs index 10be3480e..ec57ba24d 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/NotificationDataWeChatWorkExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/NotificationDataWeChatWorkExtensions.cs @@ -33,7 +33,7 @@ public static class NotificationDataWeChatWorkExtensions /// 获取消息应用标识 /// /// - public static string GetAgentIdOrNull( + public static string? GetAgentIdOrNull( this NotificationData notificationData) { return notificationData.TryGetData(AgentIdKey)?.ToString(); @@ -54,7 +54,7 @@ public static class NotificationDataWeChatWorkExtensions /// 获取接收消息的标签 /// /// - public static string GetTagOrNull( + public static string? GetTagOrNull( this NotificationData notificationData) { return notificationData.TryGetData(ToTagKey)?.ToString(); @@ -75,7 +75,7 @@ public static class NotificationDataWeChatWorkExtensions /// 获取接收消息的部门 /// /// - public static string GetPartyOrNull( + public static string? GetPartyOrNull( this NotificationData notificationData) { return notificationData.TryGetData(ToPartyKey)?.ToString(); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/NotificationDefinitionWeChatWorkExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/NotificationDefinitionWeChatWorkExtensions.cs index 58d4b2223..d61d96e9f 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/NotificationDefinitionWeChatWorkExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/NotificationDefinitionWeChatWorkExtensions.cs @@ -34,12 +34,12 @@ public static class NotificationDefinitionWeChatWorkExtensions /// 获取消息应用标识 /// /// - public static string GetAgentIdOrNull( + public static string? GetAgentIdOrNull( this NotificationDefinition notification) { if (notification.Properties.TryGetValue(AgentIdKey, out var agentIdDefine)) { - return agentIdDefine.ToString(); + return agentIdDefine?.ToString(); } return null; @@ -62,12 +62,12 @@ public static class NotificationDefinitionWeChatWorkExtensions /// 获取接收消息的标签 /// /// - public static string GetTagOrNull( + public static string? GetTagOrNull( this NotificationDefinition notification) { if (notification.Properties.TryGetValue(ToTagKey, out var tagDefine)) { - return tagDefine.ToString(); + return tagDefine?.ToString(); } return null; @@ -90,12 +90,12 @@ public static class NotificationDefinitionWeChatWorkExtensions /// 获取接收消息的部门 /// /// - public static string GetPartyOrNull( + public static string? GetPartyOrNull( this NotificationDefinition notification) { if (notification.Properties.TryGetValue(ToPartyKey, out var partyDefine)) { - return partyDefine.ToString(); + return partyDefine?.ToString(); } return null; diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/WeChat/Work/WeChatWorkNotificationPublishProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/WeChat/Work/WeChatWorkNotificationPublishProvider.cs index 84ecb2284..c1ab47ac7 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/WeChat/Work/WeChatWorkNotificationPublishProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN/Abp/Notifications/WeChat/Work/WeChatWorkNotificationPublishProvider.cs @@ -91,13 +91,13 @@ public class WeChatWorkNotificationPublishProvider : NotificationPublishProvider string agentId, string title, string content, - string description = "", - string toUser = null, - string toParty = null, - string toTag = null, + string? description = "", + string? toUser = null, + string? toParty = null, + string? toTag = null, CancellationToken cancellationToken = default) { - WeChatWorkMessage message = null; + WeChatWorkMessage? message = null; switch (context.Notification.ContentType) { diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/IWebhookNotificationContext.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/IWebhookNotificationContext.cs index f23a8b129..4f4211abe 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/IWebhookNotificationContext.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/IWebhookNotificationContext.cs @@ -3,7 +3,7 @@ namespace LINGYUN.Abp.Notifications.Webhook; public interface IWebhookNotificationContext : IServiceProviderAccessor { - WebhookNotificationData Webhook { get; set; } + WebhookNotificationData? Webhook { get; set; } NotificationInfo Notification { get; } bool Handled { get; set; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationContext.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationContext.cs index 0f351a71e..968d03c0d 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationContext.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationContext.cs @@ -5,7 +5,7 @@ public class WebhookNotificationContext : IWebhookNotificationContext { public IServiceProvider ServiceProvider { get; } public NotificationInfo Notification { get; } - public WebhookNotificationData Webhook { get; set; } + public WebhookNotificationData? Webhook { get; set; } public bool Handled { get; set; } public WebhookNotificationContext(IServiceProvider serviceProvider, NotificationInfo notification) { diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationData.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationData.cs index 561d6324a..a2d64e02c 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationData.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationData.cs @@ -7,7 +7,7 @@ public class WebhookNotificationData public string WebhookName { get; } public object Data { get; } public bool SendExactSameData { get; set; } - public WebhookHeader Headers { get; set; } + public WebhookHeader? Headers { get; set; } public WebhookNotificationData(string webhookName, object data) { WebhookName = Check.NotNullOrWhiteSpace(webhookName, nameof(webhookName)); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationPublishProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationPublishProvider.cs index d25aaaf40..6e13e433a 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationPublishProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN/Abp/Notifications/Webhook/WebhookNotificationPublishProvider.cs @@ -47,7 +47,7 @@ public class WebhookNotificationPublishProvider : NotificationPublishProvider else { await WebhookPublisher.PublishAsync( - webhookNotificationContext.Webhook.WebhookName, + webhookNotificationContext.Webhook!.WebhookName, webhookNotificationContext.Webhook.Data, context.Notification.TenantId, webhookNotificationContext.Webhook.SendExactSameData, diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/NotificationDataExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/NotificationDataExtensions.cs index 195cfc6cc..dfc74c973 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/NotificationDataExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/NotificationDataExtensions.cs @@ -11,7 +11,7 @@ public static class NotificationDataExtensions notificationData.TrySetData(UrlKey, url); } - public static string GetUrlOrNull( + public static string? GetUrlOrNull( this NotificationData notificationData) { return notificationData.TryGetData(UrlKey)?.ToString(); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/NotificationDefinitionExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/NotificationDefinitionExtensions.cs index f1b8abf26..8cf5b2363 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/NotificationDefinitionExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/NotificationDefinitionExtensions.cs @@ -97,12 +97,12 @@ public static class NotificationDefinitionExtensions /// 获取标题跳转页面 /// /// - public static string GetUrlOrNull( + public static string? GetUrlOrNull( this NotificationDefinition notification) { if (notification.Properties.TryGetValue(UrlKey, out var urlDefine)) { - return urlDefine.ToString(); + return urlDefine?.ToString(); } return null; diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/WxPusher/WxPusherNotificationPublishProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/WxPusher/WxPusherNotificationPublishProvider.cs index ffe1d8282..af6dffe59 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/WxPusher/WxPusherNotificationPublishProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/WxPusher/WxPusherNotificationPublishProvider.cs @@ -45,11 +45,7 @@ public class WxPusherNotificationPublishProvider : NotificationPublishProvider var notificationDefine = await NotificationDefinitionManager.GetOrNullAsync(context.Notification.Name); var url = context.Notification.Data.GetUrlOrNull() ?? notificationDefine?.GetUrlOrNull(); - var topicDefine = notificationDefine?.GetTopics(); - if (topicDefine.Any()) - { - topics = topicDefine; - } + topics ??= notificationDefine?.GetTopics(); var contentType = notificationDefine?.GetContentTypeOrDefault(MessageContentType.Text) ?? MessageContentType.Text; var notificationData = await NotificationDataSerializer.ToStandard(context.Notification.Data); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/DefaultNotificationDataSerializer.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/DefaultNotificationDataSerializer.cs index ed7467f2f..0a0d1c105 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/DefaultNotificationDataSerializer.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/DefaultNotificationDataSerializer.cs @@ -27,14 +27,14 @@ public class DefaultNotificationDataSerializer : INotificationDataSerializer, IS title != null && title is not LocalizableStringInfo) { - var titleObj = JsonConvert.DeserializeObject(title.ToString()); + var titleObj = JsonConvert.DeserializeObject(title.ToString()!)!; source.TrySetData("title", titleObj); } if (source.ExtraProperties.TryGetValue("message", out var message) && message != null && message is not LocalizableStringInfo) { - var messageObj = JsonConvert.DeserializeObject(message.ToString()); + var messageObj = JsonConvert.DeserializeObject(message.ToString()!)!; source.TrySetData("message", messageObj); } @@ -42,7 +42,7 @@ public class DefaultNotificationDataSerializer : INotificationDataSerializer, IS description != null && description is not LocalizableStringInfo) { - var descriptionObj = JsonConvert.DeserializeObject(description.ToString()); + var descriptionObj = JsonConvert.DeserializeObject(description.ToString()!)!; source.TrySetData("description", descriptionObj); } } @@ -68,7 +68,7 @@ public class DefaultNotificationDataSerializer : INotificationDataSerializer, IS } else { - var titleInfo = source.TryGetData("title").As(); + var titleInfo = source.TryGetData("title")!.As(); var titleLocalizer = await _localizerFactory.CreateByResourceNameAsync(titleInfo.ResourceName); title = titleLocalizer[titleInfo.Name].Value; if (titleInfo.Values != null) @@ -81,7 +81,7 @@ public class DefaultNotificationDataSerializer : INotificationDataSerializer, IS } } } - var messageInfo = source.TryGetData("message").As(); + var messageInfo = source.TryGetData("message")!.As(); var messageLocalizer = await _localizerFactory.CreateByResourceNameAsync(messageInfo.ResourceName); message = messageLocalizer[messageInfo.Name].Value; if (messageInfo.Values != null) diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs index b3aef5a5e..4f0b875e2 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs @@ -22,10 +22,10 @@ public interface INotificationSender Task SendNofiterAsync( string name, NotificationData data, - IEnumerable users = null, + IEnumerable? users = null, Guid? tenantId = null, NotificationSeverity severity = NotificationSeverity.Info, - IEnumerable useProviders = null); + IEnumerable? useProviders = null); /// /// 发送模板通知 /// @@ -39,8 +39,8 @@ public interface INotificationSender Task SendNofiterAsync( string name, NotificationTemplate template, - IEnumerable users = null, + IEnumerable? users = null, Guid? tenantId = null, NotificationSeverity severity = NotificationSeverity.Info, - IEnumerable useProviders = null); + IEnumerable? useProviders = null); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSenderExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSenderExtensions.cs index 9a1940e48..d2d9e1c75 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSenderExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSenderExtensions.cs @@ -20,7 +20,7 @@ public static class INotificationSenderExtensions [NotNull] this INotificationSender sender, [NotNull] string name, [NotNull] NotificationData data, - UserIdentifier user = null, + UserIdentifier? user = null, Guid? tenantId = null, NotificationSeverity severity = NotificationSeverity.Info) { @@ -49,7 +49,7 @@ public static class INotificationSenderExtensions [NotNull] this INotificationSender sender, [NotNull] string name, [NotNull] NotificationTemplate template, - UserIdentifier user = null, + UserIdentifier? user = null, Guid? tenantId = null, NotificationSeverity severity = NotificationSeverity.Info) { diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs index 68b34c762..8d305d1bc 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs @@ -43,7 +43,7 @@ public interface INotificationStore Task> GetUserSubscriptionsAsync( Guid? tenantId, string notificationName, - IEnumerable identifiers = null, + IEnumerable? identifiers = null, CancellationToken cancellationToken = default); Task> GetUserSubscriptionsAsync( diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs index fd0c9f661..f2f5c9501 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs @@ -90,7 +90,7 @@ public interface INotificationSubscriptionManager Task> GetUsersSubscriptionsAsync( Guid? tenantId, string notificationName, - IEnumerable identifiers = null, + IEnumerable? identifiers = null, CancellationToken cancellationToken = default); /// /// 获取用户订阅列表 diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs index 20cf7f307..ad66fde49 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs @@ -59,10 +59,10 @@ public class NotificationSender : INotificationSender, ITransientDependency public async virtual Task SendNofiterAsync( string name, NotificationData data, - IEnumerable users = null, + IEnumerable? users = null, Guid? tenantId = null, NotificationSeverity severity = NotificationSeverity.Info, - IEnumerable useProviders = null) + IEnumerable? useProviders = null) { return await PublishNofiterAsync(name, data, users, tenantId, severity, useProviders); } @@ -70,10 +70,10 @@ public class NotificationSender : INotificationSender, ITransientDependency public async virtual Task SendNofiterAsync( string name, NotificationTemplate template, - IEnumerable users = null, + IEnumerable? users = null, Guid? tenantId = null, NotificationSeverity severity = NotificationSeverity.Info, - IEnumerable useProviders = null) + IEnumerable? useProviders = null) { return await PublishNofiterAsync(name, template, users, tenantId, severity, useProviders); } @@ -81,10 +81,10 @@ public class NotificationSender : INotificationSender, ITransientDependency protected async virtual Task PublishNofiterAsync( string name, TData data, - IEnumerable users = null, + IEnumerable? users = null, Guid? tenantId = null, NotificationSeverity severity = NotificationSeverity.Info, - IEnumerable useProviders = null) + IEnumerable? useProviders = null) { var eto = new NotificationEto(data) { diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs index 5b3e870ed..b64e584bb 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs @@ -19,7 +19,7 @@ internal class NotificationSubscriptionManager : INotificationSubscriptionManage public async virtual Task> GetUsersSubscriptionsAsync( Guid? tenantId, string notificationName, - IEnumerable identifiers = null, + IEnumerable? identifiers = null, CancellationToken cancellationToken = default) { return await _store.GetUserSubscriptionsAsync(tenantId, notificationName, identifiers, cancellationToken); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs index 1a0d870ce..48acedf31 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs @@ -48,7 +48,7 @@ public class NotificationDataMappingDictionary : Dictionary /// /// - public NotificationDataMappingDictionaryItem GetMapItemOrDefault(string provider, string name) + public NotificationDataMappingDictionaryItem? GetMapItemOrDefault(string provider, string name) { if (ContainsKey(provider)) { diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItemExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItemExtensions.cs index d3d8bb25a..a00efb177 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItemExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItemExtensions.cs @@ -5,7 +5,7 @@ namespace LINGYUN.Abp.Notifications; public static class NotificationDataMappingDictionaryItemExtensions { - public static NotificationDataMappingDictionaryItem GetOrNullDefault( + public static NotificationDataMappingDictionaryItem? GetOrNullDefault( this IEnumerable items, string name) { diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs index 8e52907a7..e3b06d645 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs @@ -14,16 +14,16 @@ public abstract class NotificationPublishProvider : INotificationPublishProvider { public abstract string Name { get; } - public IAbpLazyServiceProvider ServiceProvider { protected get; set; } + public IAbpLazyServiceProvider ServiceProvider { protected get; set; } = default!; public ILoggerFactory LoggerFactory => ServiceProvider.LazyGetRequiredService(); protected ILogger Logger => _lazyLogger.Value; - private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); + private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName!) ?? NullLogger.Instance, true); public ICancellationTokenProvider CancellationTokenProvider => ServiceProvider.LazyGetService(NullCancellationTokenProvider.Instance); - private IEnumerable _interceptors; + private IEnumerable? _interceptors; protected IEnumerable Interceptors => _interceptors ??= ServiceProvider.LazyGetService>() ?? Enumerable.Empty(); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProviderManager.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProviderManager.cs index 164fb2ed5..0b3cecb82 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProviderManager.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProviderManager.cs @@ -21,7 +21,7 @@ public class NotificationPublishProviderManager : INotificationPublishProviderMa () => options.Value .PublishProviders .Select(type => serviceProvider.GetRequiredService(type) as INotificationPublishProvider) - .ToList(), + .ToList()!, true ); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs index 8d893b4bc..890709ece 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs @@ -100,7 +100,7 @@ public class NullNotificationStore : INotificationStore, ISingletonDependency public Task> GetUserSubscriptionsAsync( Guid? tenantId, string notificationName, - IEnumerable identifiers, + IEnumerable? identifiers = null, CancellationToken cancellationToken = default) { return Task.FromResult(new List()); diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/EditionCacheItem.cs b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/EditionCacheItem.cs index c139d2998..96ee9ac57 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/EditionCacheItem.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/EditionCacheItem.cs @@ -10,14 +10,14 @@ public class EditionCacheItem { private const string CacheKeyFormat = "t:{0}"; - public EditionInfo Value { get; set; } + public EditionInfo? Value { get; set; } public EditionCacheItem() { } - public EditionCacheItem(EditionInfo value) + public EditionCacheItem(EditionInfo? value) { Value = value; } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/EditionStore.cs b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/EditionStore.cs index 455d02e79..f1e91aa22 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/EditionStore.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/EditionStore.cs @@ -25,12 +25,12 @@ public class EditionStore : IEditionStore, ITransientDependency Cache = cache; } - public async virtual Task FindByTenantAsync(Guid tenantId) + public async virtual Task FindByTenantAsync(Guid tenantId) { - return (await GetCacheItemAsync(tenantId)).Value; + return (await GetCacheItemAsync(tenantId))?.Value; } - protected async virtual Task GetCacheItemAsync(Guid tenantId) + protected async virtual Task GetCacheItemAsync(Guid tenantId) { var cacheKey = CalculateCacheKey(tenantId); @@ -47,9 +47,9 @@ public class EditionStore : IEditionStore, ITransientDependency } } - protected async virtual Task SetCacheAsync(string cacheKey, [CanBeNull] TenantDto tenant) + protected async virtual Task SetCacheAsync(string cacheKey, [CanBeNull] TenantDto tenant) { - EditionInfo editionInfo = null; + EditionInfo? editionInfo = null; if (tenant != null && tenant.EditionId.HasValue && !tenant.EditionName.IsNullOrWhiteSpace()) { editionInfo = new EditionInfo(tenant.EditionId.Value, tenant.EditionName); diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/TenantCacheItem.cs b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/TenantCacheItem.cs index 0dba67619..467296073 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/TenantCacheItem.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/TenantCacheItem.cs @@ -10,18 +10,18 @@ public class TenantCacheItem { private const string CacheKeyFormat = "i:{0},n:{1}"; - public TenantConfiguration Value { get; set; } + public TenantConfiguration? Value { get; set; } public TenantCacheItem() { } - public TenantCacheItem(TenantConfiguration value) + public TenantCacheItem(TenantConfiguration? value) { Value = value; } - public static string CalculateCacheKey(Guid? id, string name) + public static string CalculateCacheKey(Guid? id, string? name = null) { if (id == null && name.IsNullOrWhiteSpace()) { diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/TenantStore.cs b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/TenantStore.cs index 650b6f72b..deb593449 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/TenantStore.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN/Abp/MultiTenancy/Saas/TenantStore.cs @@ -30,14 +30,14 @@ public class TenantStore : ITenantStore, ITransientDependency TenantAppService = tenantAppService; } - public async virtual Task FindAsync(string name) + public async virtual Task FindAsync(string name) { - return (await GetCacheItemAsync(null, name)).Value; + return (await GetCacheItemAsync(null, name))?.Value; } - public async virtual Task FindAsync(Guid id) + public async virtual Task FindAsync(Guid id) { - return (await GetCacheItemAsync(id, null)).Value; + return (await GetCacheItemAsync(id, null))?.Value; } public async virtual Task> GetListAsync(bool includeDetails = false) @@ -68,18 +68,18 @@ public class TenantStore : ITenantStore, ITransientDependency } [Obsolete("Use FindAsync method.")] - public virtual TenantConfiguration Find(string name) + public virtual TenantConfiguration? Find(string name) { return AsyncHelper.RunSync(async () => await FindAsync(name)); } [Obsolete("Use FindAsync method.")] - public virtual TenantConfiguration Find(Guid id) + public virtual TenantConfiguration? Find(Guid id) { return AsyncHelper.RunSync(async () => await FindAsync(id)); } - protected async virtual Task GetCacheItemAsync(Guid? id, string name) + protected async virtual Task GetCacheItemAsync(Guid? id, string? name = null) { var cacheKey = CalculateCacheKey(id, name); @@ -119,7 +119,7 @@ public class TenantStore : ITenantStore, ITransientDependency protected async virtual Task SetCacheAsync( string cacheKey, - [CanBeNull] TenantDto tenant, + [CanBeNull] TenantDto? tenant, [CanBeNull] IReadOnlyList connectionStrings) { var tenantConfiguration = tenant != null @@ -130,6 +130,7 @@ public class TenantStore : ITenantStore, ITransientDependency : null; if (tenantConfiguration != null && connectionStrings?.Any() == true) { + tenantConfiguration.ConnectionStrings ??= new ConnectionStrings(); foreach (var connectionString in connectionStrings) { tenantConfiguration.ConnectionStrings.Add( @@ -142,7 +143,7 @@ public class TenantStore : ITenantStore, ITransientDependency return cacheItem; } - protected virtual string CalculateCacheKey(Guid? id, string name) + protected virtual string CalculateCacheKey(Guid? id, string? name = null) { return TenantCacheItem.CalculateCacheKey(id, name); } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionCreateOrUpdateBase.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionCreateOrUpdateBase.cs index 8dc15002c..351bfaed3 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionCreateOrUpdateBase.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionCreateOrUpdateBase.cs @@ -9,5 +9,5 @@ public abstract class EditionCreateOrUpdateBase : ExtensibleObject [Required] [DynamicStringLength(typeof(EditionConsts), nameof(EditionConsts.MaxDisplayNameLength))] [Display(Name = "EditionName")] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionDto.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionDto.cs index 1833e2cfb..0e65f317d 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionDto.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionDto.cs @@ -6,6 +6,6 @@ namespace LINGYUN.Abp.Saas.Editions; public class EditionDto : ExtensibleAuditedEntityDto, IHasConcurrencyStamp { - public string DisplayName { get; set; } - public string ConcurrencyStamp { get; set; } + public string DisplayName { get; set; } = default!; + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionGetListInput.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionGetListInput.cs index d7404113b..dbe785134 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionGetListInput.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionGetListInput.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.Saas.Editions; public class EditionGetListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionUpdateDto.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionUpdateDto.cs index b56243128..545784239 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionUpdateDto.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Editions/Dto/EditionUpdateDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.Saas.Editions; public class EditionUpdateDto : EditionCreateOrUpdateBase, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionGetByNameInput.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionGetByNameInput.cs index 40f991bb3..52e0cd0ad 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionGetByNameInput.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionGetByNameInput.cs @@ -11,5 +11,5 @@ public class TenantConnectionGetByNameInput [Required] [DynamicStringLength(typeof(TenantConnectionStringConsts), nameof(TenantConnectionStringConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringCheckInput.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringCheckInput.cs index 0adf83f11..abc8b53d0 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringCheckInput.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringCheckInput.cs @@ -7,12 +7,12 @@ namespace LINGYUN.Abp.Saas.Tenants; public class TenantConnectionStringCheckInput { [Required] - public string Provider { get; set; } + public string Provider { get; set; } = default!; - public string Name { get; set; } + public string? Name { get; set; } [Required] [DisableAuditing] [DynamicStringLength(typeof(TenantConnectionStringConsts), nameof(TenantConnectionStringConsts.MaxValueLength))] - public string ConnectionString { get; set; } + public string ConnectionString { get; set; } = default!; } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringDto.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringDto.cs index bf7408ea4..6ede5fb84 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringDto.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringDto.cs @@ -2,7 +2,7 @@ public class TenantConnectionStringDto { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string Value { get; set; } + public string? Value { get; set; } } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringSetInput.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringSetInput.cs index 691867cd5..084640c05 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringSetInput.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantConnectionStringSetInput.cs @@ -7,9 +7,9 @@ public class TenantConnectionStringSetInput { [Required] [DynamicStringLength(typeof(TenantConnectionStringConsts), nameof(TenantConnectionStringConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [Required] [DynamicStringLength(typeof(TenantConnectionStringConsts), nameof(TenantConnectionStringConsts.MaxValueLength))] - public string Value { get; set; } + public string Value { get; set; } = default!; } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantCreateDto.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantCreateDto.cs index ff7400f47..357198fae 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantCreateDto.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantCreateDto.cs @@ -14,11 +14,11 @@ public class TenantCreateDto : TenantCreateOrUpdateBase [Required] [EmailAddress] [MaxLength(256)] - public string AdminEmailAddress { get; set; } + public string AdminEmailAddress { get; set; } = default!; [Required] [MaxLength(128)] - public string AdminPassword { get; set; } + public string AdminPassword { get; set; } = default!; /// /// 使用共享数据库 @@ -29,7 +29,7 @@ public class TenantCreateDto : TenantCreateOrUpdateBase /// 默认数据库连接字符串 /// [DynamicStringLength(typeof(TenantConnectionStringConsts), nameof(TenantConnectionStringConsts.MaxValueLength))] - public string DefaultConnectionString { get; set; } + public string? DefaultConnectionString { get; set; } /// /// 其他数据库连接 diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantCreateOrUpdateBase.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantCreateOrUpdateBase.cs index f6a65c570..3a0a0b6ee 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantCreateOrUpdateBase.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantCreateOrUpdateBase.cs @@ -9,8 +9,7 @@ public abstract class TenantCreateOrUpdateBase : ExtensibleObject { [Required] [DynamicStringLength(typeof(TenantConsts), nameof(TenantConsts.MaxNameLength))] - - public string Name { get; set; } + public string Name { get; set; } = default!; public bool IsActive { get; set; } = true; diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantDto.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantDto.cs index 0da8799ea..c03715677 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantDto.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantDto.cs @@ -6,13 +6,13 @@ namespace LINGYUN.Abp.Saas.Tenants; public class TenantDto : ExtensibleAuditedEntityDto, IHasConcurrencyStamp { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string NormalizedName { get; set; } + public string NormalizedName { get; set; } = default!; public Guid? EditionId { get; set; } - public string EditionName { get; set; } + public string? EditionName { get; set; } public bool IsActive { get; set; } @@ -20,5 +20,5 @@ public class TenantDto : ExtensibleAuditedEntityDto, IHasConcurrencyStamp public DateTime? DisableTime { get; set; } - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } \ No newline at end of file diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantGetByNameInput.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantGetByNameInput.cs index 3a7f0c9b1..10eeba3e2 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantGetByNameInput.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantGetByNameInput.cs @@ -7,7 +7,7 @@ public class TenantGetByNameInput { [Required] [DynamicStringLength(typeof(TenantConsts), nameof(TenantConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; public TenantGetByNameInput() { } public TenantGetByNameInput(string name) diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantGetListInput.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantGetListInput.cs index 335e50ca3..13bf371d0 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantGetListInput.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantGetListInput.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.Saas.Tenants; public class TenantGetListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } } \ No newline at end of file diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantUpdateDto.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantUpdateDto.cs index d753455b9..15ee68801 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantUpdateDto.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN/Abp/Saas/Tenants/Dto/TenantUpdateDto.cs @@ -3,5 +3,5 @@ namespace LINGYUN.Abp.Saas.Tenants; public class TenantUpdateDto : TenantCreateOrUpdateBase, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } \ No newline at end of file diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/AbpSaasApplicationMappers.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/AbpSaasApplicationMappers.cs index a6141f1cc..89efcf5fc 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/AbpSaasApplicationMappers.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/AbpSaasApplicationMappers.cs @@ -21,7 +21,7 @@ public partial class TenantToTenantDtoMapper : MapperBase [MapPropertyFromSource(nameof(TenantDto.EditionName), Use = nameof(TryGetEditionName))] public override partial void Map(Tenant source, TenantDto destination); - private static string TryGetEditionName(Tenant source) + private static string? TryGetEditionName(Tenant source) { return source?.Edition?.DisplayName; } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/Editions/EditionAppService.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/Editions/EditionAppService.cs index 81fcdd12e..964fbd729 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/Editions/EditionAppService.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/Editions/EditionAppService.cs @@ -30,7 +30,7 @@ public class EditionAppService : AbpSaasAppServiceBase, IEditionAppService await EditionRepository.InsertAsync(edition); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(edition); } @@ -54,10 +54,10 @@ public class EditionAppService : AbpSaasAppServiceBase, IEditionAppService { var totalCount = await EditionRepository.GetCountAsync(input.Filter); var editions = await EditionRepository.GetListAsync( + input.Filter, input.Sorting, input.MaxResultCount, - input.SkipCount, - input.Filter + input.SkipCount ); return new PagedResultDto( @@ -80,7 +80,7 @@ public class EditionAppService : AbpSaasAppServiceBase, IEditionAppService await EditionRepository.UpdateAsync(edition); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(edition); } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/Tenants/TenantAppService.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/Tenants/TenantAppService.cs index c3f938279..b36919cac 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/Tenants/TenantAppService.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN/Abp/Saas/Tenants/TenantAppService.cs @@ -62,10 +62,10 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService { var count = await TenantRepository.GetCountAsync(input.Filter); var list = await TenantRepository.GetListAsync( + input.Filter, input.Sorting, input.MaxResultCount, - input.SkipCount, - input.Filter + input.SkipCount ); return new PagedResultDto( @@ -86,7 +86,7 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService if (!input.UseSharedDatabase) { - tenant.SetDefaultConnectionString(input.DefaultConnectionString); + tenant.SetDefaultConnectionString(input.DefaultConnectionString!); if (input.ConnectionStrings.Any()) { @@ -99,7 +99,7 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService await TenantRepository.InsertAsync(tenant); - CurrentUnitOfWork.OnCompleted(async () => + CurrentUnitOfWork!.OnCompleted(async () => { var eto = new TenantCreatedEto { @@ -149,7 +149,7 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService input.MapExtraPropertiesTo(tenant); await TenantRepository.UpdateAsync(tenant); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(tenant); } @@ -178,7 +178,7 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService EntityVersion = tenant.EntityVersion, DefaultConnectionString = tenant.FindDefaultConnectionString(), }; - CurrentUnitOfWork.OnCompleted(async () => + CurrentUnitOfWork!.OnCompleted(async () => { await EventBus.PublishAsync(eto); }); @@ -218,7 +218,7 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService var oldConnectionString = tenant.FindConnectionString(input.Name); - CurrentUnitOfWork.OnCompleted(async () => + CurrentUnitOfWork!.OnCompleted(async () => { var eto = new TenantConnectionStringUpdatedEto { @@ -254,7 +254,7 @@ public class TenantAppService : AbpSaasAppServiceBase, ITenantAppService tenant.RemoveConnectionString(name); - CurrentUnitOfWork.OnCompleted(async () => + CurrentUnitOfWork!.OnCompleted(async () => { var eto = new TenantConnectionStringUpdatedEto { diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Editions/EditionEto.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Editions/EditionEto.cs index d1db721ec..b7aefd77f 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Editions/EditionEto.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Editions/EditionEto.cs @@ -10,7 +10,7 @@ public class EditionEto : IHasEntityVersion { public Guid Id { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public int EntityVersion { get; set; } } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Tenants/TenantDeletedEto.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Tenants/TenantDeletedEto.cs index 7a27bcf73..e772fffb6 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Tenants/TenantDeletedEto.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Tenants/TenantDeletedEto.cs @@ -8,5 +8,5 @@ namespace LINGYUN.Abp.Saas.Tenants; public class TenantDeletedEto : TenantEto { public RecycleStrategy Strategy { get; set; } - public string DefaultConnectionString { get; set; } + public string? DefaultConnectionString { get; set; } } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Tenants/TenantEto.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Tenants/TenantEto.cs index 819a7ef0a..0db82ec85 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Tenants/TenantEto.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Tenants/TenantEto.cs @@ -10,7 +10,7 @@ public class TenantEto : IHasEntityVersion { public Guid Id { get; set; } - public string Name { get; set; } + public string Name { get; set; } = default!; public int EntityVersion { get; set; } } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/AbpSaasDbProperties.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/AbpSaasDbProperties.cs index bfe3255c8..1c4845845 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/AbpSaasDbProperties.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/AbpSaasDbProperties.cs @@ -6,7 +6,7 @@ public class AbpSaasDbProperties { public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix; - public static string DbSchema { get; set; } = AbpCommonDbProperties.DbSchema; + public static string? DbSchema { get; set; } = AbpCommonDbProperties.DbSchema; public const string ConnectionStringName = "AbpSaas"; } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/Edition.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/Edition.cs index 018cfe2a1..dd55177ef 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/Edition.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/Edition.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Abp.Saas.Editions; public class Edition : FullAuditedAggregateRoot, IHasEntityVersion { - public virtual string DisplayName { get; protected set; } + public virtual string DisplayName { get; protected set; } = default!; public virtual int EntityVersion { get; protected set; } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/EditionCacheItem.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/EditionCacheItem.cs index 96090eebc..9a8ddd54c 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/EditionCacheItem.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/EditionCacheItem.cs @@ -10,14 +10,14 @@ public class EditionCacheItem { private const string CacheKeyFormat = "t:{0}"; - public EditionInfo Value { get; set; } + public EditionInfo? Value { get; set; } public EditionCacheItem() { } - public EditionCacheItem(EditionInfo value) + public EditionCacheItem(EditionInfo? value) { Value = value; } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/EditionStore.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/EditionStore.cs index 5fffb75c3..b82513068 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/EditionStore.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/EditionStore.cs @@ -28,7 +28,7 @@ public class EditionStore : IEditionStore, ITransientDependency Cache = cache; } - public async virtual Task FindByTenantAsync(Guid tenantId) + public async virtual Task FindByTenantAsync(Guid tenantId) { return (await GetCacheItemAsync(tenantId)).Value; } @@ -50,7 +50,7 @@ public class EditionStore : IEditionStore, ITransientDependency } } - protected async virtual Task SetCacheAsync(string cacheKey, [CanBeNull] Edition edition) + protected async virtual Task SetCacheAsync(string cacheKey, [CanBeNull] Edition? edition) { var editionInfo = edition != null ? ObjectMapper.Map(edition) : null; var cacheItem = new EditionCacheItem(editionInfo); diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/IEditionRepository.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/IEditionRepository.cs index 1e7925d78..21ddcbf93 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/IEditionRepository.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Editions/IEditionRepository.cs @@ -12,22 +12,22 @@ public interface IEditionRepository : IBasicRepository Guid id, CancellationToken cancellationToken = default); - Task FindByDisplayNameAsync( + Task FindByDisplayNameAsync( string displayName, CancellationToken cancellationToken = default); - Task FindByTenantIdAsync( + Task FindByTenantIdAsync( Guid tenantId, CancellationToken cancellationToken = default); Task> GetListAsync( - string sorting = null, + string? filter = null, + string? sorting = nameof(Edition.DisplayName), int maxResultCount = 10, int skipCount = 0, - string filter = null, CancellationToken cancellationToken = default); Task GetCountAsync( - string filter = null, + string? filter = null, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/ConnectionStringInvalidator.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/ConnectionStringInvalidator.cs index 287fc579d..ff2184d28 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/ConnectionStringInvalidator.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/ConnectionStringInvalidator.cs @@ -22,7 +22,7 @@ public class ConnectionStringInvalidator : await RemoveTenantCache(eventData.Id, eventData.Name); } - protected async virtual Task RemoveTenantCache(Guid tenantId, string tenantName = null) + protected async virtual Task RemoveTenantCache(Guid tenantId, string? tenantName = null) { var keys = new string[] { diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/DataBaseConnectionStringCheckResult.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/DataBaseConnectionStringCheckResult.cs index e79456841..cce0b5efe 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/DataBaseConnectionStringCheckResult.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/DataBaseConnectionStringCheckResult.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.Saas.Tenants; public class DataBaseConnectionStringCheckResult : AbpConnectionStringCheckResult { - public Exception Error { get; set; } + public Exception? Error { get; set; } } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/ITenantRepository.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/ITenantRepository.cs index ad2884a0b..63642bf46 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/ITenantRepository.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/ITenantRepository.cs @@ -10,31 +10,31 @@ namespace LINGYUN.Abp.Saas.Tenants; public interface ITenantRepository : IBasicRepository { [Obsolete("Use FindByNameAsync method.")] - Tenant FindByName( + Tenant? FindByName( string name, bool includeDetails = true ); [Obsolete("Use FindAsync method.")] - Tenant FindById( + Tenant? FindById( Guid id, bool includeDetails = true ); - Task FindByNameAsync( + Task FindByNameAsync( string name, bool includeDetails = true, CancellationToken cancellationToken = default); Task> GetListAsync( - string sorting = null, - int maxResultCount = int.MaxValue, + string? filter = null, + string? sorting = nameof(Tenant.Name), + int maxResultCount = 10, int skipCount = 0, - string filter = null, bool includeDetails = false, CancellationToken cancellationToken = default); Task GetCountAsync( - string filter = null, + string? filter = null, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/Tenant.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/Tenant.cs index 8ad2f1176..9f2d4cfa6 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/Tenant.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/Tenant.cs @@ -15,9 +15,9 @@ public class Tenant : FullAuditedAggregateRoot, IHasEntityVersion { protected const string DefaultConnectionStringName = Volo.Abp.Data.ConnectionStrings.DefaultConnectionStringName; - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; - public virtual string NormalizedName { get; protected set; } + public virtual string? NormalizedName { get; protected set; } public virtual bool IsActive { get; set; } @@ -27,7 +27,7 @@ public class Tenant : FullAuditedAggregateRoot, IHasEntityVersion public virtual Guid? EditionId { get; set; } - public virtual Edition Edition { get; set; } + public virtual Edition Edition { get; set; } = default!; public virtual int EntityVersion { get; protected set; } @@ -38,11 +38,11 @@ public class Tenant : FullAuditedAggregateRoot, IHasEntityVersion ConnectionStrings = new Collection(); } - protected internal Tenant(Guid id, [NotNull] string name, [CanBeNull] string normalizedName) + protected internal Tenant(Guid id, [NotNull] string name, [CanBeNull] string? normalizedName) : base(id) { SetName(name); - SetNormalizedName(normalizedName); + SetNormalizedName(normalizedName ?? name); ConnectionStrings = new Collection(); } @@ -58,13 +58,13 @@ public class Tenant : FullAuditedAggregateRoot, IHasEntityVersion } [CanBeNull] - public virtual string FindDefaultConnectionString() + public virtual string? FindDefaultConnectionString() { return FindConnectionString(DefaultConnectionStringName); } [CanBeNull] - public virtual string FindConnectionString(string name) + public virtual string? FindConnectionString(string name) { return ConnectionStrings.FirstOrDefault(c => c.Name == name)?.Value; } @@ -108,7 +108,7 @@ public class Tenant : FullAuditedAggregateRoot, IHasEntityVersion Name = Check.NotNullOrWhiteSpace(name, nameof(name), TenantConsts.MaxNameLength); } - protected internal virtual void SetNormalizedName([CanBeNull] string normalizedName) + protected internal virtual void SetNormalizedName([CanBeNull] string? normalizedName) { NormalizedName = normalizedName; AddLocalEvent(new TenantChangedEvent(Id, NormalizedName)); diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantCacheItem.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantCacheItem.cs index f7c982e5f..364fc75aa 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantCacheItem.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantCacheItem.cs @@ -10,18 +10,18 @@ public class TenantCacheItem { private const string CacheKeyFormat = "i:{0},n:{1}"; - public TenantConfiguration Value { get; set; } + public TenantConfiguration? Value { get; set; } public TenantCacheItem() { } - public TenantCacheItem(TenantConfiguration value) + public TenantCacheItem(TenantConfiguration? value) { Value = value; } - public static string CalculateCacheKey(Guid? id, string name) + public static string CalculateCacheKey(Guid? id, string? name) { if (id == null && name.IsNullOrWhiteSpace()) { diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantCacheItemInvalidator.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantCacheItemInvalidator.cs index aa5a3d167..1beb67f86 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantCacheItemInvalidator.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantCacheItemInvalidator.cs @@ -48,7 +48,7 @@ public class TenantCacheItemInvalidator : await RemoveTenantCache(eventData.Entity.Id, eventData.Entity.Name); } - protected async virtual Task RemoveTenantCache(Guid tenantId, string tenantName = null) + protected async virtual Task RemoveTenantCache(Guid tenantId, string? tenantName = null) { var removeTenantKeys = new string[] { diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantConnectionString.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantConnectionString.cs index cbb9f7bd7..fe74e83cb 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantConnectionString.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantConnectionString.cs @@ -9,9 +9,9 @@ public class TenantConnectionString : Entity { public virtual Guid TenantId { get; protected set; } - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; - public virtual string Value { get; protected set; } + public virtual string Value { get; protected set; } = default!; protected TenantConnectionString() { diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantStore.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantStore.cs index fe254027e..8da24093d 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantStore.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantStore.cs @@ -32,12 +32,12 @@ public class TenantStore : ITenantStore, ITransientDependency TenantsCache = tenantsCache; } - public async virtual Task FindAsync(string name) + public async virtual Task FindAsync(string name) { return (await GetCacheItemAsync(null, name)).Value; } - public async virtual Task FindAsync(Guid id) + public async virtual Task FindAsync(Guid id) { return (await GetCacheItemAsync(id, null)).Value; } @@ -57,18 +57,18 @@ public class TenantStore : ITenantStore, ITransientDependency } [Obsolete("Use FindAsync method.")] - public virtual TenantConfiguration Find(string name) + public virtual TenantConfiguration? Find(string name) { return (GetCacheItem(null, name)).Value; } [Obsolete("Use FindAsync method.")] - public virtual TenantConfiguration Find(Guid id) + public virtual TenantConfiguration? Find(Guid id) { return (GetCacheItem(id, null)).Value; } - protected async virtual Task GetCacheItemAsync(Guid? id, string name) + protected async virtual Task GetCacheItemAsync(Guid? id, string? name) { var cacheKey = CalculateCacheKey(id, name); @@ -99,7 +99,7 @@ public class TenantStore : ITenantStore, ITransientDependency throw new AbpException("Both id and name can't be invalid."); } - protected async virtual Task SetCacheAsync(string cacheKey, [CanBeNull] Tenant tenant) + protected async virtual Task SetCacheAsync(string cacheKey, [CanBeNull] Tenant? tenant) { var tenantConfiguration = tenant != null ? ObjectMapper.Map(tenant) : null; var cacheItem = new TenantCacheItem(tenantConfiguration); @@ -108,7 +108,7 @@ public class TenantStore : ITenantStore, ITransientDependency } [Obsolete("Use GetCacheItemAsync method.")] - protected virtual TenantCacheItem GetCacheItem(Guid? id, string name) + protected virtual TenantCacheItem GetCacheItem(Guid? id, string? name) { var cacheKey = CalculateCacheKey(id, name); @@ -140,7 +140,7 @@ public class TenantStore : ITenantStore, ITransientDependency } [Obsolete("Use SetCacheAsync method.")] - protected virtual TenantCacheItem SetCache(string cacheKey, [CanBeNull] Tenant tenant) + protected virtual TenantCacheItem SetCache(string cacheKey, [CanBeNull] Tenant? tenant) { var tenantConfiguration = tenant != null ? ObjectMapper.Map(tenant) : null; var cacheItem = new TenantCacheItem(tenantConfiguration); @@ -148,7 +148,7 @@ public class TenantStore : ITenantStore, ITransientDependency return cacheItem; } - protected virtual string CalculateCacheKey(Guid? id, string name) + protected virtual string CalculateCacheKey(Guid? id, string? name) { return TenantCacheItem.CalculateCacheKey(id, name); } diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantsCacheItem.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantsCacheItem.cs index de4308691..8d99fd3f1 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantsCacheItem.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN/Abp/Saas/Tenants/TenantsCacheItem.cs @@ -15,11 +15,11 @@ public class TenantsCacheItem public List Tenants { get; set; } public TenantsCacheItem() { - + Tenants = new List(); } public TenantsCacheItem(List tenants) { - Tenants = tenants; + Tenants = tenants ?? []; } public static string CalculateCacheKey(bool includeDetails = false) { diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN/Abp/Saas/EntityFrameworkCore/EfCoreEditionRepository.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN/Abp/Saas/EntityFrameworkCore/EfCoreEditionRepository.cs index 0c4949caf..228662326 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN/Abp/Saas/EntityFrameworkCore/EfCoreEditionRepository.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN/Abp/Saas/EntityFrameworkCore/EfCoreEditionRepository.cs @@ -31,7 +31,7 @@ public class EfCoreEditionRepository : EfCoreRepository x.EditionId == id, GetCancellationToken(cancellationToken)); } - public async virtual Task FindByDisplayNameAsync( + public async virtual Task FindByDisplayNameAsync( string displayName, CancellationToken cancellationToken = default) { @@ -40,7 +40,7 @@ public class EfCoreEditionRepository : EfCoreRepository t.DisplayName == displayName, GetCancellationToken(cancellationToken)); } - public async virtual Task FindByTenantIdAsync( + public async virtual Task FindByTenantIdAsync( Guid tenantId, CancellationToken cancellationToken = default) { @@ -60,19 +60,19 @@ public class EfCoreEditionRepository : EfCoreRepository GetCountAsync( - string filter = null, + string? filter = null, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.DisplayName.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.DisplayName.Contains(filter!)) .CountAsync(GetCancellationToken(cancellationToken)); } public async virtual Task> GetListAsync( - string sorting = null, + string? filter = null, + string? sorting = nameof(Edition.DisplayName), int maxResultCount = 10, int skipCount = 0, - string filter = null, CancellationToken cancellationToken = default) { if (sorting.IsNullOrWhiteSpace()) @@ -80,7 +80,7 @@ public class EfCoreEditionRepository : EfCoreRepository x.DisplayName.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.DisplayName.Contains(filter!)) .OrderBy(sorting) .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellationToken)); diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN/Abp/Saas/EntityFrameworkCore/EfCoreTenantRepository.cs b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN/Abp/Saas/EntityFrameworkCore/EfCoreTenantRepository.cs index 0bbed3fd4..fb4176a65 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN/Abp/Saas/EntityFrameworkCore/EfCoreTenantRepository.cs +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN/Abp/Saas/EntityFrameworkCore/EfCoreTenantRepository.cs @@ -1,31 +1,31 @@ using LINGYUN.Abp.Saas.Editions; using LINGYUN.Abp.Saas.Tenants; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Dynamic.Core; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; - -namespace LINGYUN.Abp.Saas.EntityFrameworkCore; - -public class EfCoreTenantRepository : EfCoreRepository, ITenantRepository -{ - public EfCoreTenantRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - - } - - public async override Task FindAsync(Guid id, bool includeDetails = true, CancellationToken cancellationToken = default) +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace LINGYUN.Abp.Saas.EntityFrameworkCore; + +public class EfCoreTenantRepository : EfCoreRepository, ITenantRepository +{ + public EfCoreTenantRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + + } + + public async override Task FindAsync(Guid id, bool includeDetails = true, CancellationToken cancellationToken = default) { - var dbContext = await GetDbContextAsync(); + var dbContext = await GetDbContextAsync(); var tenantDbSet = dbContext.Set() - .IncludeDetails(includeDetails); - + .IncludeDetails(includeDetails); + if (includeDetails) { var editionDbSet = dbContext.Set(); @@ -48,29 +48,29 @@ public class EfCoreTenantRepository : EfCoreRepository t.Id) + } + + return await tenantDbSet + .OrderBy(t => t.Id) .FirstOrDefaultAsync(t => t.Id == id, GetCancellationToken(cancellationToken)); - } - - public async virtual Task FindByNameAsync( - string name, - bool includeDetails = true, - CancellationToken cancellationToken = default) + } + + public async virtual Task FindByNameAsync( + string name, + bool includeDetails = true, + CancellationToken cancellationToken = default) { - var dbContext = await GetDbContextAsync(); + var dbContext = await GetDbContextAsync(); var tenantDbSet = dbContext.Set() - .IncludeDetails(includeDetails); - + .IncludeDetails(includeDetails); + if (includeDetails) { var editionDbSet = dbContext.Set(); var queryable = from tenant in tenantDbSet join edition in editionDbSet on tenant.EditionId equals edition.Id into eg from e in eg.DefaultIfEmpty() - where tenant.Name.Equals(name) || tenant.NormalizedName.Equals(name) + where tenant.Name.Equals(name) || tenant.NormalizedName!.Equals(name) orderby tenant.Id select new { @@ -85,26 +85,26 @@ public class EfCoreTenantRepository : EfCoreRepository t.Id) - .FirstOrDefaultAsync(t => t.Name == name, GetCancellationToken(cancellationToken)); - } - - [Obsolete("Use FindByNameAsync method.")] - public virtual Tenant FindByName(string name, bool includeDetails = true) - { + } + + return await tenantDbSet + .OrderBy(t => t.Id) + .FirstOrDefaultAsync(t => t.Name == name, GetCancellationToken(cancellationToken)); + } + + [Obsolete("Use FindByNameAsync method.")] + public virtual Tenant? FindByName(string name, bool includeDetails = true) + { var tenantDbSet = DbContext.Set() - .IncludeDetails(includeDetails); - + .IncludeDetails(includeDetails); + if (includeDetails) { var editionDbSet = DbContext.Set(); var queryable = from tenant in tenantDbSet join edition in editionDbSet on tenant.EditionId equals edition.Id into eg from e in eg.DefaultIfEmpty() - where tenant.Name.Equals(name) || tenant.NormalizedName.Equals(name) + where tenant.Name.Equals(name) || tenant.NormalizedName!.Equals(name) orderby tenant.Id select new { @@ -119,19 +119,19 @@ public class EfCoreTenantRepository : EfCoreRepository t.Id) - .FirstOrDefault(t => t.Name == name); - } - - [Obsolete("Use FindAsync method.")] - public virtual Tenant FindById(Guid id, bool includeDetails = true) - { + } + + return tenantDbSet + .OrderBy(t => t.Id) + .FirstOrDefault(t => t.Name == name); + } + + [Obsolete("Use FindAsync method.")] + public virtual Tenant? FindById(Guid id, bool includeDetails = true) + { var tenantDbSet = DbContext.Set() - .IncludeDetails(includeDetails); - + .IncludeDetails(includeDetails); + if (includeDetails) { var editionDbSet = DbContext.Set(); @@ -153,20 +153,20 @@ public class EfCoreTenantRepository : EfCoreRepository t.Id) - .FirstOrDefault(t => t.Id == id); - } - - public async virtual Task> GetListAsync( - string sorting = null, - int maxResultCount = int.MaxValue, - int skipCount = 0, - string filter = null, - bool includeDetails = false, - CancellationToken cancellationToken = default) + } + + return tenantDbSet + .OrderBy(t => t.Id) + .FirstOrDefault(t => t.Id == id); + } + + public async virtual Task> GetListAsync( + string? filter = null, + string? sorting = nameof(Tenant.Name), + int maxResultCount = 10, + int skipCount = 0, + bool includeDetails = false, + CancellationToken cancellationToken = default) { if (sorting.IsNullOrWhiteSpace()) { @@ -180,7 +180,7 @@ public class EfCoreTenantRepository : EfCoreRepository u.Name.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.Name.Contains(filter!)) .OrderBy(sorting); var combinedResult = await (from tenant in tenantDbSet @@ -191,18 +191,18 @@ public class EfCoreTenantRepository : EfCoreRepository o.EditionId, - // i => i.Id, - // (tenant, edition) => new { tenant, edition }) - // .Skip(skipCount) - // .Take(maxResultCount) + //var combinedResult = await tenantDbSet + // .Join( + // editionDbSet, + // o => o.EditionId, + // i => i.Id, + // (tenant, edition) => new { tenant, edition }) + // .Skip(skipCount) + // .Take(maxResultCount) // .ToListAsync(GetCancellationToken(cancellationToken)); return combinedResult.Select(s => @@ -210,33 +210,32 @@ public class EfCoreTenantRepository : EfCoreRepository u.Name.Contains(filter)) - .OrderBy(sorting) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); - } - - public async virtual Task GetCountAsync(string filter = null, CancellationToken cancellationToken = default) - { - return await (await GetQueryableAsync()) - .WhereIf( - !filter.IsNullOrWhiteSpace(), - u => - u.Name.Contains(filter) - ).CountAsync(cancellationToken: cancellationToken); - } - - [Obsolete("Use WithDetailsAsync method.")] - public override IQueryable WithDetails() - { - return GetQueryable().IncludeDetails(); - } - - public override async Task> WithDetailsAsync() - { - return (await GetQueryableAsync()).IncludeDetails(); - } -} + } + + return await (await GetDbSetAsync()) + .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.Name.Contains(filter!)) + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } + + public async virtual Task GetCountAsync(string? filter = null, CancellationToken cancellationToken = default) + { + return await (await GetQueryableAsync()) + .WhereIf( + !filter.IsNullOrWhiteSpace(), + u => u.Name.Contains(filter!) + ).CountAsync(cancellationToken: cancellationToken); + } + + [Obsolete("Use WithDetailsAsync method.")] + public override IQueryable WithDetails() + { + return GetQueryable().IncludeDetails(); + } + + public override async Task> WithDetailsAsync() + { + return (await GetQueryableAsync()).IncludeDetails(); + } +} diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionCreateDto.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionCreateDto.cs index a88ee582b..a8f86130e 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionCreateDto.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionCreateDto.cs @@ -7,5 +7,5 @@ public class SettingDefinitionCreateDto : SettingDefinitionCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(SettingDefinitionRecordConsts), nameof(SettingDefinitionRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionCreateOrUpdateDto.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionCreateOrUpdateDto.cs index 0ff426836..a7903b994 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionCreateOrUpdateDto.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionCreateOrUpdateDto.cs @@ -10,17 +10,17 @@ public abstract class SettingDefinitionCreateOrUpdateDto : IHasExtraProperties { [Required] [DynamicStringLength(typeof(SettingDefinitionRecordConsts), nameof(SettingDefinitionRecordConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(SettingDefinitionRecordConsts), nameof(SettingDefinitionRecordConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } [DynamicStringLength(typeof(SettingDefinitionRecordConsts), nameof(SettingDefinitionRecordConsts.MaxDefaultValueLength))] - public string DefaultValue { get; set; } + public string? DefaultValue { get; set; } public bool IsVisibleToClients { get; set; } - public List Providers { get; set; } + public List? Providers { get; set; } public bool IsInherited { get; set; } diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionDto.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionDto.cs index 3c9efe526..d4982f50f 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionDto.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionDto.cs @@ -5,13 +5,13 @@ namespace LINGYUN.Abp.SettingManagement; public class SettingDefinitionDto : ExtensibleObject { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; - public string Description { get; set; } + public string? Description { get; set; } - public string DefaultValue { get; set; } + public string? DefaultValue { get; set; } public bool IsVisibleToClients { get; set; } diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionGetListInput.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionGetListInput.cs index 697b238bf..9e3452536 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionGetListInput.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Dto/SettingDefinitionGetListInput.cs @@ -1,7 +1,7 @@ namespace LINGYUN.Abp.SettingManagement; public class SettingDefinitionGetListInput { - public string Filter { get; set; } + public string? Filter { get; set; } - public string ProviderName { get; set; } + public string? ProviderName { get; set; } } diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/ISettingTestAppService.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/ISettingTestAppService.cs index 9817bbfe9..9cc8361ba 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/ISettingTestAppService.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/ISettingTestAppService.cs @@ -12,5 +12,5 @@ public class SendTestEmailInput { [Required] [EmailAddress] - public string EmailAddress { get; set; } + public string EmailAddress { get; set; } = default!; } diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingAppService.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingAppService.cs index 0e04081cc..81f7571a9 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingAppService.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingAppService.cs @@ -69,7 +69,7 @@ public class SettingAppService : ApplicationService, ISettingAppService, ISettin await SettingManager.SetGlobalAsync(setting.Name, setting.Value); } - CurrentUnitOfWork.OnCompleted(async () => + CurrentUnitOfWork!.OnCompleted(async () => { // 发送刷新用户缓存事件 await EventBus.PublishAsync(new CurrentApplicationConfigurationCacheResetEventData()); @@ -91,7 +91,7 @@ public class SettingAppService : ApplicationService, ISettingAppService, ISettin await SettingManager.SetForTenantAsync(CurrentTenant.GetId(), setting.Name, setting.Value); } - CurrentUnitOfWork.OnCompleted(async () => + CurrentUnitOfWork!.OnCompleted(async () => { // 发送刷新用户缓存事件 await EventBus.PublishAsync(new CurrentApplicationConfigurationCacheResetEventData()); @@ -114,7 +114,7 @@ public class SettingAppService : ApplicationService, ISettingAppService, ISettin return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); } - protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + protected async virtual Task GetAllForProviderAsync(string providerName, string? providerKey = null) { /* * 2020-11-19 @@ -158,8 +158,8 @@ public class SettingAppService : ApplicationService, ISettingAppService, ISettin await SettingManager.GetOrNullAsync(TimingSettingNames.TimeZone, providerName, providerKey), ValueType.Option, providerName) - .AddOptions(timezones.Select(timezone => new OptionDto(timezone.Name, timezone.Value))) - .RequiredPermission("SettingManagement.TimeZone"); + ?.AddOptions(timezones.Select(timezone => new OptionDto(timezone.Name, timezone.Value))) + ?.RequiredPermission("SettingManagement.TimeZone"); settingGroups.AddGroup(sysSettingGroup); #endregion @@ -304,10 +304,10 @@ public class SettingAppService : ApplicationService, ISettingAppService, ISettin await SettingManager.GetOrNullAsync(LINGYUN.Abp.Identity.Settings.IdentitySettingNames.Session.ConcurrentLoginStrategy, providerName, providerKey), ValueType.Option, providerName) - .AddOption(L["ConcurrentLoginStrategy:None"], ConcurrentLoginStrategy.None.ToString()) - .AddOption(L["ConcurrentLoginStrategy:LogoutFromSameTypeDevicesLimit"], ConcurrentLoginStrategy.LogoutFromSameTypeDevicesLimit.ToString()) - .AddOption(L["ConcurrentLoginStrategy:LogoutFromSameTypeDevices"], ConcurrentLoginStrategy.LogoutFromSameTypeDevices.ToString()) - .AddOption(L["ConcurrentLoginStrategy:LogoutFromAllDevices"], ConcurrentLoginStrategy.LogoutFromAllDevices.ToString()); + ?.AddOption(L["ConcurrentLoginStrategy:None"], ConcurrentLoginStrategy.None.ToString()) + ?.AddOption(L["ConcurrentLoginStrategy:LogoutFromSameTypeDevicesLimit"], ConcurrentLoginStrategy.LogoutFromSameTypeDevicesLimit.ToString()) + ?.AddOption(L["ConcurrentLoginStrategy:LogoutFromSameTypeDevices"], ConcurrentLoginStrategy.LogoutFromSameTypeDevices.ToString()) + ?.AddOption(L["ConcurrentLoginStrategy:LogoutFromAllDevices"], ConcurrentLoginStrategy.LogoutFromAllDevices.ToString()); sessionSetting.AddDetail( await SettingDefinitionManager.GetAsync(LINGYUN.Abp.Identity.Settings.IdentitySettingNames.Session.LogoutFromSameTypeDevicesLimit), StringLocalizerFactory, @@ -445,14 +445,14 @@ public class SettingAppService : ApplicationService, ISettingAppService, ISettin await SettingManager.GetOrNullAsync(EmailSettingNames.DefaultFromAddress, providerName, providerKey), ValueType.String, providerName) - .RequiredPermission("SettingManagement.Emailing"); + ?.RequiredPermission("SettingManagement.Emailing"); defaultMailSetting.AddDetail( await SettingDefinitionManager.GetAsync(EmailSettingNames.DefaultFromDisplayName), StringLocalizerFactory, await SettingManager.GetOrNullAsync(EmailSettingNames.DefaultFromDisplayName, providerName, providerKey), ValueType.String, providerName) - .RequiredPermission("SettingManagement.Emailing"); + ?.RequiredPermission("SettingManagement.Emailing"); // 防止邮件设置泄露 if (await AuthorizationService.IsGrantedAsync(AbpSettingManagementPermissions.Settings.Manager)) @@ -464,21 +464,21 @@ public class SettingAppService : ApplicationService, ISettingAppService, ISettin await SettingManager.GetOrNullAsync(EmailSettingNames.Smtp.EnableSsl, providerName, providerKey), ValueType.Boolean, providerName) - .RequiredPermission("SettingManagement.Emailing"); + ?.RequiredPermission("SettingManagement.Emailing"); smtpSetting.AddDetail( await SettingDefinitionManager.GetAsync(EmailSettingNames.Smtp.UseDefaultCredentials), StringLocalizerFactory, await SettingManager.GetOrNullAsync(EmailSettingNames.Smtp.UseDefaultCredentials, providerName, providerKey), ValueType.Boolean, providerName) - .RequiredPermission("SettingManagement.Emailing"); + ?.RequiredPermission("SettingManagement.Emailing"); smtpSetting.AddDetail( await SettingDefinitionManager.GetAsync(EmailSettingNames.Smtp.Domain), StringLocalizerFactory, await SettingManager.GetOrNullAsync(EmailSettingNames.Smtp.Domain, providerName, providerKey), ValueType.String, providerName) - .RequiredPermission("SettingManagement.Emailing"); + ?.RequiredPermission("SettingManagement.Emailing"); smtpSetting.AddDetail( await SettingDefinitionManager.GetAsync(EmailSettingNames.Smtp.Host), StringLocalizerFactory, @@ -491,21 +491,21 @@ public class SettingAppService : ApplicationService, ISettingAppService, ISettin await SettingManager.GetOrNullAsync(EmailSettingNames.Smtp.Port, providerName, providerKey), ValueType.Number, providerName) - .RequiredPermission("SettingManagement.Emailing"); + ?.RequiredPermission("SettingManagement.Emailing"); smtpSetting.AddDetail( await SettingDefinitionManager.GetAsync(EmailSettingNames.Smtp.UserName), StringLocalizerFactory, await SettingManager.GetOrNullAsync(EmailSettingNames.Smtp.UserName, providerName, providerKey), ValueType.String, providerName) - .RequiredPermission("SettingManagement.Emailing"); + ?.RequiredPermission("SettingManagement.Emailing"); smtpSetting.AddDetail( await SettingDefinitionManager.GetAsync(EmailSettingNames.Smtp.Password), StringLocalizerFactory, await SettingManager.GetOrNullAsync(EmailSettingNames.Smtp.Password, providerName, providerKey), ValueType.String, providerName) - .RequiredPermission("SettingManagement.Emailing"); + ?.RequiredPermission("SettingManagement.Emailing"); // 一个占位符,用于展现发送测试邮件 smtpSetting.AddDetail( new SettingDefinition( @@ -516,8 +516,8 @@ public class SettingAppService : ApplicationService, ISettingAppService, ISettin "", ValueType.NoSet, providerName) - .WithSlot("send-test-email") - .RequiredPermission("SettingManagement.Emailing"); + ?.WithSlot("send-test-email") + ?.RequiredPermission("SettingManagement.Emailing"); } diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingDefinitionAppService.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingDefinitionAppService.cs index 1e4abf6b4..819369b5a 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingDefinitionAppService.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingDefinitionAppService.cs @@ -68,7 +68,7 @@ public class SettingDefinitionAppService : SettingManagementAppServiceBase, ISet settingDefinitionRecord = await _settingRepository.InsertAsync(settingDefinitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(settingDefinitionRecord); } @@ -84,7 +84,7 @@ public class SettingDefinitionAppService : SettingManagementAppServiceBase, ISet await _settingRepository.DeleteAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(string name) @@ -147,12 +147,12 @@ public class SettingDefinitionAppService : SettingManagementAppServiceBase, ISet UpdateByInput(definitionRecord, input); definitionRecord = await _settingRepository.UpdateAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(definitionRecord); } - protected async virtual Task FindByNameAsync(string name) + protected async virtual Task FindByNameAsync(string name) { return await _settingRepository.FindAsync(x => x.Name == name); } @@ -200,10 +200,6 @@ public class SettingDefinitionAppService : SettingManagementAppServiceBase, ISet protected virtual SettingDefinitionDto DefinitionRecordToDto(SettingDefinitionRecord definitionRecord) { - if (definitionRecord == null) - { - return null; - } var dto = new SettingDefinitionDto { Name = definitionRecord.Name, diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingV2AppService.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingV2AppService.cs index 6a49c330a..cbe5b7f2f 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingV2AppService.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingV2AppService.cs @@ -52,7 +52,7 @@ public class SettingV2AppService : SettingV2AppServiceBase, ISettingV2AppService } } - CurrentUnitOfWork.OnCompleted(async () => + CurrentUnitOfWork!.OnCompleted(async () => { await EventBus.PublishAsync(new CurrentApplicationConfigurationCacheResetEventData()); }); diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingV2AppServiceBase.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingV2AppServiceBase.cs index 3c7371af3..55ca81485 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingV2AppServiceBase.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingV2AppServiceBase.cs @@ -30,7 +30,7 @@ public abstract class SettingV2AppServiceBase : ApplicationService LocalizationResource = typeof(AbpSettingManagementResource); } - protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + protected async virtual Task GetAllForProviderAsync(string providerName, string? providerKey = null) { var result = new SettingGroupResult(); @@ -93,6 +93,10 @@ public abstract class SettingV2AppServiceBase : ApplicationService foreach (var settingGroups in settingDefines.GroupBy(x => x.GetGroupOrNull()).OrderBy(x => x.Key?.Order ?? 9999)) { + if (settingGroups.Key == null) + { + continue; + } if (!await IsEnabledSettingResource(settingGroups.Key)) { continue; @@ -100,6 +104,10 @@ public abstract class SettingV2AppServiceBase : ApplicationService var groupDto = CreateSettingGroup(settingGroups.Key); foreach (var settings in settingGroups.GroupBy(x => x.GetParentOrNull()).OrderBy(x => x.Key?.Order ?? 9999)) { + if (settings.Key == null) + { + continue; + } if (!await IsEnabledSettingResource(settings.Key)) { continue; @@ -124,25 +132,25 @@ public abstract class SettingV2AppServiceBase : ApplicationService if (valueType == ValueType.Option) { var options = setting.GetOptions(); - settingDetailsDto.AddOptions(options.Select(option => new OptionDto(option.Name, option.Value))); + settingDetailsDto?.AddOptions(options.Select(option => new OptionDto(option.Name, option.Value))); } var slot = setting.GetSlotOrNull(); if (!slot.IsNullOrWhiteSpace()) { - settingDetailsDto.WithSlot(slot); + settingDetailsDto?.WithSlot(slot); } var requiredFeatures = setting.GetRequiredFeatures(); if (requiredFeatures.Any()) { - settingDetailsDto.RequiredFeature(requiredFeatures.ToArray()); + settingDetailsDto?.RequiredFeature(requiredFeatures.ToArray()); } var requiredPermissions = setting.GetRequiredPermissions(); if (requiredPermissions.Any()) { - settingDetailsDto.RequiredPermission(requiredPermissions.ToArray()); + settingDetailsDto?.RequiredPermission(requiredPermissions.ToArray()); } } diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/TimeZoneSettingsAppService.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/TimeZoneSettingsAppService.cs index e2ce4dbc4..51c751a6d 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/TimeZoneSettingsAppService.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/TimeZoneSettingsAppService.cs @@ -35,9 +35,9 @@ public class TimeZoneSettingsAppService : SettingManagementAppServiceBase, ITime ?? UnspecifiedTimeZone; } - public async virtual Task SetMyTimezoneAsync(string timezone) + public async virtual Task SetMyTimezoneAsync(string? timezone) { - if (timezone.Equals(UnspecifiedTimeZone, StringComparison.OrdinalIgnoreCase)) + if (string.Equals(timezone, UnspecifiedTimeZone, StringComparison.OrdinalIgnoreCase)) { timezone = null; } @@ -72,9 +72,9 @@ public class TimeZoneSettingsAppService : SettingManagementAppServiceBase, ITime } [Authorize(Volo.Abp.SettingManagement.SettingManagementPermissions.TimeZone)] - public async virtual Task UpdateAsync(string timezone) + public async virtual Task UpdateAsync(string? timezone) { - if (timezone.Equals(UnspecifiedTimeZone, StringComparison.OrdinalIgnoreCase)) + if (string.Equals(timezone, UnspecifiedTimeZone, StringComparison.OrdinalIgnoreCase)) { timezone = null; } diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/UserSettingAppService.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/UserSettingAppService.cs index 976a6663b..04566268a 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/UserSettingAppService.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/UserSettingAppService.cs @@ -52,7 +52,7 @@ public class UserSettingAppService : SettingManagementAppServiceBase, IUserSetti await SettingManager.SetForCurrentUserAsync(setting.Name, setting.Value); } - CurrentUnitOfWork.OnCompleted(async () => + CurrentUnitOfWork!.OnCompleted(async () => { // 发送刷新用户缓存事件 await EventBus.PublishAsync(new CurrentApplicationConfigurationCacheResetEventData()); @@ -91,8 +91,8 @@ public class UserSettingAppService : SettingManagementAppServiceBase, IUserSetti await SettingManager.GetOrNullAsync(TimingSettingNames.TimeZone, providerName, providerKey), ValueType.Option, providerName) - .AddOptions(timezones.Select(timezone => new OptionDto(timezone.Name, timezone.Value))) - .RequiredPermission("SettingManagement.TimeZone"); + ?.AddOptions(timezones.Select(timezone => new OptionDto(timezone.Name, timezone.Value))) + ?.RequiredPermission("SettingManagement.TimeZone"); settingGroups.AddGroup(sysSettingGroup); #endregion diff --git a/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/Models/ComponentInfoModel.cs b/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/Models/ComponentInfoModel.cs index 216f36741..6d6baf3f3 100644 --- a/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/Models/ComponentInfoModel.cs +++ b/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/Models/ComponentInfoModel.cs @@ -17,8 +17,8 @@ public class ComponentInfoModel /// /// 组件状态集合 /// - public Dictionary Details { get; set; } - public ComponentInfoModel(string name, ComponentKeyModel[] keys, Dictionary details) + public Dictionary Details { get; set; } + public ComponentInfoModel(string name, ComponentKeyModel[] keys, Dictionary details) { Name = name; Keys = keys; diff --git a/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/Models/SystemInfoModel.cs b/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/Models/SystemInfoModel.cs index e12a794af..52a1d2e42 100644 --- a/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/Models/SystemInfoModel.cs +++ b/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/Models/SystemInfoModel.cs @@ -5,5 +5,5 @@ public class SystemInfoModel /// /// 组件状态集合 /// - public ComponentInfoModel[] Components { get; set; } + public ComponentInfoModel[] Components { get; set; } = default!; } diff --git a/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/SystemInfoController.cs b/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/SystemInfoController.cs index 76e091c4c..c7c79df12 100644 --- a/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/SystemInfoController.cs +++ b/aspnet-core/modules/system-info/LINGYUN.Abp.SystemInfo.HttpApi/LINGYUN/Abp/SystemInfo/SystemInfoController.cs @@ -57,7 +57,7 @@ public class SystemInfoController : AbpControllerBase new ComponentKeyModel("sys_app_start_time", "启动时间"), }; - var systemDetails = new Dictionary + var systemDetails = new Dictionary { { "sys_machine_name", Environment.MachineName }, { "sys_environment", env?.EnvironmentName ?? Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") }, @@ -115,7 +115,7 @@ public class SystemInfoController : AbpControllerBase new ComponentKeyModel("perf_active_threads", "进程总线程数"), new ComponentKeyModel("perf_thread_pool_thread_count", "线程池活动线程数"), }, - new Dictionary + new Dictionary { { "perf_total_memory", memoryMetrics.TotalMemory }, { "perf_working_set", memoryMetrics.WorkingSet }, @@ -149,7 +149,7 @@ public class SystemInfoController : AbpControllerBase new ComponentKeyModel("cap_storage", "持久化"), new ComponentKeyModel("cap_transport", "传输"), }; - var capDetails = new Dictionary + var capDetails = new Dictionary { { "cap_status", cap != null ? "正常" : "未启用" }, { "cap_version", cap != null ? cap.Version.Substring(0, 5) : "N/A" }, @@ -171,7 +171,7 @@ public class SystemInfoController : AbpControllerBase { new ComponentKeyModel("redis_status", "状态") }, - new Dictionary + new Dictionary { { "redis_status", "未注册" }, }); @@ -200,7 +200,7 @@ public class SystemInfoController : AbpControllerBase { new ComponentKeyModel("redis_status", "状态") }, - new Dictionary + new Dictionary { { "redis_status", "连接异常" }, }); @@ -242,7 +242,7 @@ public class SystemInfoController : AbpControllerBase new ComponentKeyModel("redis_evicted_keys", "被驱逐键数量"), new ComponentKeyModel("redis_avg_ttl_seconds", "平均TTL(秒)"), }; - var redisDetails = new Dictionary() + var redisDetails = new Dictionary() { { "redis_version", redisInfo.GetValueOrDefault("redis_version", "unknown") }, { "redis_mode", redisInfo.GetValueOrDefault("redis_mode", "unknown") }, diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpBackgroundTaskConcurrentException.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpBackgroundTaskConcurrentException.cs index f91a4b0f5..67da863ba 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpBackgroundTaskConcurrentException.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpBackgroundTaskConcurrentException.cs @@ -21,7 +21,7 @@ public class AbpBackgroundTaskConcurrentException : AbpJobExecutionException /// /// Execute job type /// Inner exception - public AbpBackgroundTaskConcurrentException(Type jobType, Exception innerException) + public AbpBackgroundTaskConcurrentException(Type jobType, Exception? innerException = null) : base( jobType, $"This job {jobType.Name} cannot be performed because it has been locked by another performer", @@ -35,7 +35,7 @@ public class AbpBackgroundTaskConcurrentException : AbpJobExecutionException /// Execute job type /// Exception message /// Inner exception - public AbpBackgroundTaskConcurrentException(Type jobType, string message, Exception innerException) + public AbpBackgroundTaskConcurrentException(Type jobType, string message, Exception? innerException = null) : base(jobType, message, innerException) { } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpBackgroundTasksOptions.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpBackgroundTasksOptions.cs index d90fb8e06..7199bef80 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpBackgroundTasksOptions.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpBackgroundTasksOptions.cs @@ -119,7 +119,7 @@ public class AbpBackgroundTasksOptions /// /// 指定运行节点 /// - public string NodeName { get; set; } + public string? NodeName { get; set; } public AbpBackgroundTasksOptions() { JobFetchEnabled = false; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpJobExecutionException.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpJobExecutionException.cs index 3de421a9b..bae0f1337 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpJobExecutionException.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/AbpJobExecutionException.cs @@ -36,7 +36,7 @@ public class AbpJobExecutionException : AbpException /// Execute job type /// Exception message /// Inner exception - public AbpJobExecutionException(Type jobType, string message, Exception innerException) + public AbpJobExecutionException(Type jobType, string message, Exception? innerException = null) : base(message, innerException) { JobType = jobType; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/IJobDefinitionContext.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/IJobDefinitionContext.cs index a7aa4a947..f493379eb 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/IJobDefinitionContext.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/IJobDefinitionContext.cs @@ -4,7 +4,7 @@ namespace LINGYUN.Abp.BackgroundTasks; public interface IJobDefinitionContext { - JobDefinition GetOrNull(string name); + JobDefinition? GetOrNull(string name); IReadOnlyList GetAll(); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/IJobDefinitionManager.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/IJobDefinitionManager.cs index d357ba073..ad0bf7824 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/IJobDefinitionManager.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/IJobDefinitionManager.cs @@ -10,5 +10,5 @@ public interface IJobDefinitionManager IReadOnlyList GetAll(); - JobDefinition GetOrNull(string name); + JobDefinition? GetOrNull(string name); } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinition.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinition.cs index 9ac62e7be..64bda7868 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinition.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinition.cs @@ -27,17 +27,17 @@ public class JobDefinition /// /// 描述 /// - public ILocalizableString Description { get; } + public ILocalizableString? Description { get; } /// /// 参数列表 /// - public IReadOnlyList Paramters { get; } + public IReadOnlyList? Paramters { get; } public JobDefinition( [NotNull] string name, [NotNull] Type jobType, [NotNull] ILocalizableString displayName, - [CanBeNull] IReadOnlyList paramters = null, - [CanBeNull] ILocalizableString description = null, + [CanBeNull] IReadOnlyList? paramters = null, + [CanBeNull] ILocalizableString? description = null, bool isVisibleToClients = true) { Name = name; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionContext.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionContext.cs index 5302b4209..a64f838a4 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionContext.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionContext.cs @@ -13,7 +13,7 @@ public class JobDefinitionContext : IJobDefinitionContext Jobs = jobs; } - public virtual JobDefinition GetOrNull(string name) + public virtual JobDefinition? GetOrNull(string name) { return Jobs.GetOrDefault(name); } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionManager.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionManager.cs index ecba5eb98..528bb7a66 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionManager.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionManager.cs @@ -46,7 +46,7 @@ public class JobDefinitionManager : IJobDefinitionManager, ISingletonDependency return JobDefinitions.Value.Values.ToImmutableList(); } - public virtual JobDefinition GetOrNull(string name) + public virtual JobDefinition? GetOrNull(string name) { return JobDefinitions.Value.GetOrDefault(name); } @@ -64,7 +64,7 @@ public class JobDefinitionManager : IJobDefinitionManager, ISingletonDependency foreach (var provider in providers) { - provider.Define(new JobDefinitionContext(jobs)); + provider?.Define(new JobDefinitionContext(jobs)); } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionParamter.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionParamter.cs index d31e0fb7c..0daf57c46 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionParamter.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDefinitionParamter.cs @@ -11,12 +11,12 @@ public class JobDefinitionParamter public ILocalizableString DisplayName { get; } - public ILocalizableString Description { get; } + public ILocalizableString? Description { get; } public JobDefinitionParamter( [NotNull] string name, [NotNull] ILocalizableString displayName, - [CanBeNull] ILocalizableString description = null, + [CanBeNull] ILocalizableString? description = null, bool required = false) { Name = name; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDispatcherSelectorListExtensions.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDispatcherSelectorListExtensions.cs index d78d68a26..12ec03f45 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDispatcherSelectorListExtensions.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobDispatcherSelectorListExtensions.cs @@ -12,7 +12,7 @@ public static class JobDispatcherSelectorListExtensions public static void AddNamespace( [NotNull] this IJobDispatcherSelectorList selectors, [NotNull] string namespaceName, - [CanBeNull] Action setup = null) + [CanBeNull] Action? setup = null) { Check.NotNull(selectors, nameof(selectors)); @@ -29,7 +29,7 @@ public static class JobDispatcherSelectorListExtensions selectors.Add(selector); } - public static void Add([NotNull] this IJobDispatcherSelectorList selectors, [CanBeNull] Action setup = null) + public static void Add([NotNull] this IJobDispatcherSelectorList selectors, [CanBeNull] Action? setup = null) where TJob : IJobRunnable { Check.NotNull(selectors, nameof(selectors)); @@ -56,7 +56,7 @@ public static class JobDispatcherSelectorListExtensions selectors.RemoveAll(s => s.Name == selectorName); } - public static void AddAll([NotNull] this IJobDispatcherSelectorList selectors, [CanBeNull] Action setup = null) + public static void AddAll([NotNull] this IJobDispatcherSelectorList selectors, [CanBeNull] Action? setup = null) { Check.NotNull(selectors, nameof(selectors)); @@ -76,7 +76,7 @@ public static class JobDispatcherSelectorListExtensions [NotNull] this IJobDispatcherSelectorList selectors, string selectorName, Func predicate, - [CanBeNull] Action setup = null) + [CanBeNull] Action? setup = null) { Check.NotNull(selectors, nameof(selectors)); @@ -95,7 +95,7 @@ public static class JobDispatcherSelectorListExtensions public static void Add( [NotNull] this IJobDispatcherSelectorList selectors, Func predicate, - [CanBeNull] Action setup = null) + [CanBeNull] Action? setup = null) { var selector = new JobTypeSelector(Guid.NewGuid().ToString("N"), predicate); @@ -119,4 +119,11 @@ public static class JobDispatcherSelectorListExtensions Check.NotNull(selectors, nameof(selectors)); return selectors.Any(s => s.Predicate(jobType)); } + + public static JobTypeSelector GetJobTypeSelector([NotNull] this IJobDispatcherSelectorList selectors, Type jobType) + { + Check.NotNull(selectors, nameof(selectors)); + // 取最后一次注册作业配置 + return selectors.Last(x => x.Predicate(jobType)); + } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobEventBase.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobEventBase.cs index 716c3d0bf..5f661416c 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobEventBase.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobEventBase.cs @@ -24,15 +24,15 @@ public abstract class JobEventBase : IJobEvent var currentTenant = context.ServiceProvider.GetRequiredService(); using (currentTenant.Change(context.EventData.TenantId)) { - Logger.LogInformation("Job {Group}-{Name} after event with {Event} has executing.", context.EventData.Group, context.EventData.Name, typeof(TEvent).Name); + Logger.LogDebug("Job {Group}-{Name} after event with {Event} has executing.", context.EventData.Group, context.EventData.Name, typeof(TEvent).Name); await OnJobAfterExecutedAsync(context); - Logger.LogInformation("Job {Group}-{Name} after event with {Event} was executed.", context.EventData.Group, context.EventData.Name, typeof(TEvent).Name); + Logger.LogDebug("Job {Group}-{Name} after event with {Event} was executed.", context.EventData.Group, context.EventData.Name, typeof(TEvent).Name); } } } catch (Exception ex) { - Logger.LogError("Failed to execute event, error:" + GetSourceException(ex).Message); + Logger.LogWarning("Failed to execute event, error:" + GetSourceException(ex).Message); } } @@ -45,15 +45,15 @@ public abstract class JobEventBase : IJobEvent var currentTenant = context.ServiceProvider.GetRequiredService(); using (currentTenant.Change(context.EventData.TenantId)) { - Logger.LogInformation("Job {Group}-{Name} before event with {Event} executing.", context.EventData.Group, context.EventData.Name, typeof(TEvent).Name); + Logger.LogDebug("Job {Group}-{Name} before event with {Event} executing.", context.EventData.Group, context.EventData.Name, typeof(TEvent).Name); await OnJobBeforeExecutedAsync(context); - Logger.LogInformation("Job {Group}-{Name} before event with {Event} was executed.", context.EventData.Group, context.EventData.Name, typeof(TEvent).Name); + Logger.LogDebug("Job {Group}-{Name} before event with {Event} was executed.", context.EventData.Group, context.EventData.Name, typeof(TEvent).Name); } } } catch (Exception ex) { - Logger.LogError("Failed to execute preprocessing event, error:" + GetSourceException(ex).Message); + Logger.LogWarning("Failed to execute preprocessing event, error:" + GetSourceException(ex).Message); } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobEventData.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobEventData.cs index 55f52a99e..79a698b3b 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobEventData.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobEventData.cs @@ -37,15 +37,15 @@ public class JobEventData /// /// 错误明细 /// - public Exception Exception { get; } + public Exception? Exception { get; } /// /// 任务描述 /// - public string Description { get; set; } + public string? Description { get; set; } /// /// 返回参数 /// - public string Result { get; set; } + public string? Result { get; set; } /// /// 触发次数 /// @@ -80,7 +80,7 @@ public class JobEventData string group, string name, IReadOnlyDictionary args, - Exception exception = null, + Exception? exception = null, CancellationToken cancellationToken = default) { Key = key; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobInfo.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobInfo.cs index c5d58e40f..dc0f634fb 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobInfo.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobInfo.cs @@ -8,7 +8,7 @@ public class JobInfo /// /// 任务标识 /// - public string Id { get; set; } + public string Id { get; set; } = default!; /// /// 租户标识 /// @@ -16,19 +16,19 @@ public class JobInfo /// /// 任务名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 任务分组 /// - public string Group { get; set; } + public string Group { get; set; } = default!; /// /// 任务类型 /// - public string Type { get; set; } + public string Type { get; set; } = default!; /// /// 返回参数 /// - public string Result { get; set; } + public string? Result { get; set; } /// /// 作业来源 /// @@ -44,7 +44,7 @@ public class JobInfo /// /// 描述 /// - public string Description { get; set; } + public string? Description { get; set; } /// /// 创建时间 /// @@ -72,7 +72,7 @@ public class JobInfo /// /// Cron表达式,如果是周期性任务需要指定 /// - public string Cron { get; set; } + public string? Cron { get; set; } /// /// 触发次数 /// @@ -112,7 +112,7 @@ public class JobInfo /// /// 指定运行节点 /// - public string NodeName { get; set; } + public string? NodeName { get; set; } /// /// 计算作业可触发次数 /// diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobRunnableContext.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobRunnableContext.cs index ff1d097e1..15e8e00ab 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobRunnableContext.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobRunnableContext.cs @@ -9,16 +9,16 @@ public class JobRunnableContext public Type JobType { get; } public IServiceProvider ServiceProvider { get; } public IReadOnlyDictionary JobData { get; } - public object Result { get; private set; } - private Func GetCacheData { get; set; } - private Action SetCacheData { get; set; } + public object? Result { get; private set; } + private Func? GetCacheData { get; set; } + private Action? SetCacheData { get; set; } public CancellationToken CancellationToken { get; } public JobRunnableContext( Type jobType, IServiceProvider serviceProvider, IReadOnlyDictionary jobData, - Func getCache = null, - Action setCache = null, + Func? getCache = null, + Action? setCache = null, CancellationToken cancellationToken = default) { JobType = jobType; @@ -45,7 +45,6 @@ public class JobRunnableContext SetCacheData?.Invoke(key, value); } -#nullable enable /// /// 获取缓存数据 /// @@ -59,5 +58,4 @@ public class JobRunnableContext } return null; } -#nullable disable } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobRunnableContextExtensions.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobRunnableContextExtensions.cs index f5da58d43..6fe3fcf48 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobRunnableContextExtensions.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobRunnableContextExtensions.cs @@ -1,21 +1,22 @@ using Microsoft.Extensions.DependencyInjection; using System; +using Volo.Abp; namespace LINGYUN.Abp.BackgroundTasks; public static class JobRunnableContextExtensions { - public static T GetService(this JobRunnableContext context) + public static T? GetService(this JobRunnableContext context) { return context.ServiceProvider.GetService(); } - public static object GetService(this JobRunnableContext context, Type serviceType) + public static object? GetService(this JobRunnableContext context, Type serviceType) { return context.ServiceProvider.GetService(serviceType); } - public static T GetRequiredService(this JobRunnableContext context) + public static T GetRequiredService(this JobRunnableContext context) where T : notnull { return context.ServiceProvider.GetRequiredService(); } @@ -27,7 +28,11 @@ public static class JobRunnableContextExtensions public static string GetString(this JobRunnableContext context, string key) { - return context.GetJobData(key).ToString(); + var strVal = context.GetJobData(key).ToString(); + + Check.NotNull(strVal, nameof(strVal)); + + return strVal; } public static string GetOrDefaultString(this JobRunnableContext context, string key, string defaultValue = "") @@ -44,10 +49,10 @@ public static class JobRunnableContextExtensions { if (context.TryGetJobData(key, out var data) && data != null) { - value = data.ToString(); + value = data.ToString()!; return true; } - value = default; + value = default!; return false; } @@ -111,7 +116,7 @@ public static class JobRunnableContextExtensions throw new ArgumentException($"Job required data [{key}] not specified."); } - public static bool TryGetJobData(this JobRunnableContext context, string key, out object value) + public static bool TryGetJobData(this JobRunnableContext context, string key, out object? value) { if (context.JobData.TryGetValue(key, out value)) { diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobTypeSelector.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobTypeSelector.cs index 58e9fbecf..1a97a15e9 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobTypeSelector.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN/Abp/BackgroundTasks/JobTypeSelector.cs @@ -8,8 +8,8 @@ public class JobTypeSelector : NamedTypeSelector string name, Func predicate, int? lockTimeOut = null, - string nodeName = null, - string cron = null, + string? nodeName = null, + string? cron = null, JobPriority? priority = null, int? interval = null, int? maxCount = null, @@ -33,7 +33,7 @@ public class JobTypeSelector : NamedTypeSelector /// /// 指定运行节点 /// - public string NodeName { get; set; } + public string? NodeName { get; set; } /// /// 任务优先级 /// @@ -41,7 +41,7 @@ public class JobTypeSelector : NamedTypeSelector /// /// Cron表达式,如果是周期性任务需要指定 /// - public string Cron { get; set; } + public string? Cron { get; set; } /// /// 间隔时间,单位秒,与Cron表达式冲突 /// diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/IJobActionDefinitionContext.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/IJobActionDefinitionContext.cs index 02fb3a009..90de5eb16 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/IJobActionDefinitionContext.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/IJobActionDefinitionContext.cs @@ -4,7 +4,7 @@ namespace LINGYUN.Abp.BackgroundTasks.Activities; public interface IJobActionDefinitionContext { - JobActionDefinition GetOrNull(string name); + JobActionDefinition? GetOrNull(string name); IReadOnlyList GetAll(); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/IJobActionDefinitionManager.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/IJobActionDefinitionManager.cs index 2c62a9182..f1fc43717 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/IJobActionDefinitionManager.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/IJobActionDefinitionManager.cs @@ -10,5 +10,5 @@ public interface IJobActionDefinitionManager IReadOnlyList GetAll(); - JobActionDefinition GetOrNull(string name); + JobActionDefinition? GetOrNull(string name); } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobAction.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobAction.cs index f9af05183..e888957a0 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobAction.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobAction.cs @@ -4,6 +4,6 @@ namespace LINGYUN.Abp.BackgroundTasks.Activities; public class JobAction { - public string Name { get; set; } - public Dictionary Paramters { get; set; } + public string Name { get; set; } = default!; + public Dictionary Paramters { get; set; } = default!; } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinition.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinition.cs index 4172a6dc8..5e2727294 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinition.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinition.cs @@ -22,7 +22,7 @@ public class JobActionDefinition /// /// 描述 /// - public ILocalizableString Description { get; } + public ILocalizableString? Description { get; } /// /// 参数列表 /// @@ -40,7 +40,7 @@ public class JobActionDefinition [NotNull] JobActionType type, [NotNull] ILocalizableString displayName, [NotNull] IList paramters, - ILocalizableString description = null) + ILocalizableString? description = null) { Name = name; Type = type; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinitionContext.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinitionContext.cs index dfe33a282..b1de0de75 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinitionContext.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinitionContext.cs @@ -12,7 +12,7 @@ public class JobActionDefinitionContext : IJobActionDefinitionContext Actions = actions; } - public virtual JobActionDefinition GetOrNull(string name) + public virtual JobActionDefinition? GetOrNull(string name) { return Actions.GetOrDefault(name); } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinitionManager.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinitionManager.cs index b85cd5a7a..fe1680939 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinitionManager.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionDefinitionManager.cs @@ -46,7 +46,7 @@ public class JobActionDefinitionManager : IJobActionDefinitionManager, ISingleto return ActionDefinitions.Value.Values.ToImmutableList(); } - public virtual JobActionDefinition GetOrNull(string name) + public virtual JobActionDefinition? GetOrNull(string name) { return ActionDefinitions.Value.GetOrDefault(name); } @@ -64,7 +64,7 @@ public class JobActionDefinitionManager : IJobActionDefinitionManager, ISingleto foreach (var provider in providers) { - provider.Define(new JobActionDefinitionContext(actions)); + provider?.Define(new JobActionDefinitionContext(actions)); } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionEvent.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionEvent.cs index 8bcbffc97..e4d8a81b5 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionEvent.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionEvent.cs @@ -42,7 +42,7 @@ public class JobActionEvent : JobEventBase, ITransientDependency if (definition == null) { - Logger.LogWarning($"Cannot execute job action {definition.Name}, Because it's not registered."); + Logger.LogWarning($"Cannot execute job action {action.Name}, Because it's not registered."); continue; } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionParamter.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionParamter.cs index 122b14285..74a3d9cb5 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionParamter.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN/Abp/BackgroundTasks/Activities/JobActionParamter.cs @@ -8,12 +8,12 @@ public class JobActionParamter public string Name { get; set; } public bool Required { get; set; } public ILocalizableString DisplayName { get; set; } - public ILocalizableString Description { get; set; } + public ILocalizableString? Description { get; set; } public JobActionParamter( [NotNull] string name, [NotNull] ILocalizableString displayName, - [CanBeNull] ILocalizableString description = null, + [CanBeNull] ILocalizableString? description = null, bool required = false) { Name = name; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/LINGYUN/Abp/BackgroundTasks/DistributedLocking/JobDistributedLockingProvider.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/LINGYUN/Abp/BackgroundTasks/DistributedLocking/JobDistributedLockingProvider.cs index d531afd43..488b48a26 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/LINGYUN/Abp/BackgroundTasks/DistributedLocking/JobDistributedLockingProvider.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/LINGYUN/Abp/BackgroundTasks/DistributedLocking/JobDistributedLockingProvider.cs @@ -28,7 +28,7 @@ public class JobDistributedLockingProvider : IJobLockProvider, ISingletonDepende await LockCache.GetOrCreateAsync(jobKey, (entry) => { entry.SetAbsoluteExpiration(TimeSpan.FromSeconds(lockSeconds)); - entry.RegisterPostEvictionCallback(async (object key, object value, EvictionReason reason, object state) => + entry.RegisterPostEvictionCallback(async (object key, object? value, EvictionReason reason, object? state) => { if (reason == EvictionReason.Expired && value is IAbpDistributedLockHandle handleValue) { @@ -49,7 +49,10 @@ public class JobDistributedLockingProvider : IJobLockProvider, ISingletonDepende { if (LockCache.TryGetValue(jobKey, out var handle)) { - await handle.DisposeAsync(); + if (handle != null) + { + await handle.DisposeAsync(); + } LockCache.Remove(jobKey); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN/Abp/BackgroundTasks/EventBus/DistributedJobDispatcher.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN/Abp/BackgroundTasks/EventBus/DistributedJobDispatcher.cs index 6fb12bc86..f39d819e0 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN/Abp/BackgroundTasks/EventBus/DistributedJobDispatcher.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN/Abp/BackgroundTasks/EventBus/DistributedJobDispatcher.cs @@ -37,7 +37,7 @@ public class DistributedJobDispatcher : IJobDispatcher, ITransientDependency public async virtual Task DispatchAsync( IEnumerable jobs, - string nodeName = null, + string? nodeName = null, Guid? tenantId = null, CancellationToken cancellationToken = default) { diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN/Abp/BackgroundTasks/EventBus/JobEventData.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN/Abp/BackgroundTasks/EventBus/JobEventData.cs index dbb9c4bca..2f619f116 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN/Abp/BackgroundTasks/EventBus/JobEventData.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN/Abp/BackgroundTasks/EventBus/JobEventData.cs @@ -10,6 +10,6 @@ namespace LINGYUN.Abp.BackgroundTasks.EventBus; public class JobEventData : IMultiTenant { public Guid? TenantId { get; set; } - public string NodeName { get; set; } + public string? NodeName { get; set; } public List IdList { get; set; } = new List(); } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/JobExecutedFailedProvider.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/JobExecutedFailedProvider.cs index c2bb43e09..495e7c4b2 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/JobExecutedFailedProvider.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/JobExecutedFailedProvider.cs @@ -85,7 +85,7 @@ public class JobExecutedFailedProvider : JobExecutedProvider, ITransientDependen var template = context.Action.Paramters.GetOrDefault(PropertyTemplate)?.ToString() ?? ""; var subject = context.Action.Paramters.GetOrDefault(PropertySubject)?.ToString() ?? "From job execute exception"; var from = context.Action.Paramters.GetOrDefault(PropertyFrom)?.ToString() ?? ""; - var errorMessage = context.Event.EventData.Exception.GetBaseException().Message; + var errorMessage = context.Event.EventData.Exception?.GetBaseException().Message; if (template.IsNullOrWhiteSpace()) { @@ -106,7 +106,7 @@ public class JobExecutedFailedProvider : JobExecutedProvider, ITransientDependen Type = context.Event.EventData.Args.GetOrDefault(nameof(JobInfo.Type)) ?? context.Event.EventData.Type.Name, Triggertime = context.Event.EventData.RunTime.ToString("yyyy-MM-dd HH:mm:ss"), Message = errorMessage, - Tenantname = context.Event.EventData.Args.GetOrDefault(nameof(IMultiTenant.TenantId)), + Tenantname = context.Event.EventData.Args?.GetOrDefault(nameof(IMultiTenant.TenantId)), Footer = footer, }; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/HttpRequestJobBase.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/HttpRequestJobBase.cs index a7ab7eba3..ad752a500 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/HttpRequestJobBase.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/HttpRequestJobBase.cs @@ -20,8 +20,8 @@ public abstract class HttpRequestJobBase // 可选, 请求时指定区域性 public const string PropertyCulture = "culture"; - protected ICurrentTenant CurrentTenant { get; set; } - protected IJsonSerializer JsonSerializer { get; set; } + protected ICurrentTenant CurrentTenant { get; set; } = default!; + protected IJsonSerializer JsonSerializer { get; set; } = default!; protected virtual void InitJob(JobRunnableContext context) { @@ -29,14 +29,14 @@ public abstract class HttpRequestJobBase JsonSerializer = context.GetRequiredService(); } - protected async virtual Task RequestAsync( + protected async virtual Task RequestAsync( JobRunnableContext context, HttpMethod httpMethod, string requestUrl, - object data = null, + object? data = null, string contentType = MimeTypes.Application.Json, - IReadOnlyDictionary headers = null, - string clientName = null) + IReadOnlyDictionary? headers = null, + string? clientName = null) { var response = await RequestAsync( context, @@ -78,10 +78,10 @@ public abstract class HttpRequestJobBase JobRunnableContext context, HttpMethod httpMethod, string requestUrl, - object data = null, + object? data = null, string contentType = MimeTypes.Application.Json, - IReadOnlyDictionary headers = null, - string clientName = null) + IReadOnlyDictionary? headers = null, + string? clientName = null) { context.TryGetString(PropertyCulture, out var culture); using (CultureHelper.Use(culture ?? "en")) @@ -107,9 +107,9 @@ public abstract class HttpRequestJobBase protected virtual HttpRequestMessage BuildRequestMessage( HttpMethod httpMethod, string requestUrl, - object data = null, + object? data = null, string contentType = MimeTypes.Application.Json, - IReadOnlyDictionary headers = null) + IReadOnlyDictionary? headers = null) { var httpRequestMesasge = new HttpRequestMessage(httpMethod, requestUrl); if (data != null) @@ -130,7 +130,7 @@ public abstract class HttpRequestJobBase protected virtual void AddHeaders( HttpRequestMessage requestMessage, - IReadOnlyDictionary headers = null) + IReadOnlyDictionary? headers = null) { if (CurrentTenant?.Id.HasValue == true) { diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/SendEmailJob.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/SendEmailJob.cs index 3a77f82c3..008a45b8d 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/SendEmailJob.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/SendEmailJob.cs @@ -81,7 +81,7 @@ public class SendEmailJob : IJobRunnable catch { } } - object model = null; + object? model = null; if (context.TryGetString(PropertyModel, out var modelString) && !modelString.IsNullOrWhiteSpace()) { try diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/ServiceInvocationJob.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/ServiceInvocationJob.cs index b5c98602e..e1637b3fd 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/ServiceInvocationJob.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN/Abp/BackgroundTasks/Jobs/ServiceInvocationJob.cs @@ -64,6 +64,9 @@ public class ServiceInvocationJob : IJobRunnable var type = context.GetString(PropertyService); var method = context.GetString(PropertyMethod); var serviceType = Type.GetType(type, true); + + Check.NotNull(serviceType, nameof(serviceType)); + var serviceMethod = serviceType.GetMethod(method, BindingFlags.Instance | BindingFlags.Public | BindingFlags.FlattenHierarchy); if (serviceMethod == null) { @@ -76,6 +79,8 @@ public class ServiceInvocationJob : IJobRunnable } } } + Check.NotNull(serviceMethod, nameof(serviceMethod)); + context.TryGetString(PropertyCulture, out var culture); context.TryGetString(PropertyProvider, out var provider); provider ??= "http"; @@ -120,12 +125,12 @@ public class ServiceInvocationJob : IJobRunnable if (context.TryGetString(PropertyData, out var data)) { var json = JsonNode.Parse(data); - foreach ( var param in methodParamters) + foreach(var param in methodParamters) { - var input = json[param.Name]; + var input = json![param.Name!]; if (input != null) { - invokeParameters.Add(input.Deserialize(param.ParameterType)); + invokeParameters.Add(input.Deserialize(param.ParameterType!)!); } } } @@ -133,14 +138,14 @@ public class ServiceInvocationJob : IJobRunnable if (serviceMethod.ReturnType.GenericTypeArguments.IsNullOrEmpty()) { // 直接调用 - var taskProxy = (Task)serviceMethod.Invoke(clientProxy, invokeParameters.ToArray()); + var taskProxy = (Task)serviceMethod.Invoke(clientProxy, invokeParameters.ToArray())!; await taskProxy; } else { // 有返回值的调用 var returnType = serviceMethod.ReturnType.GenericTypeArguments[0]; - var callResult = serviceMethod.Invoke(clientProxy, invokeParameters.ToArray()); + var callResult = serviceMethod.Invoke(clientProxy, invokeParameters.ToArray())!; var result = (Task)callResult; context.SetResult(await GetResultAsync(result, returnType)); } @@ -208,11 +213,11 @@ public class ServiceInvocationJob : IJobRunnable serviceMethod); // 调用参数 - var invokeParameters = new Dictionary(); + var invokeParameters = new Dictionary(); if (context.TryGetString(PropertyData, out var data)) { var jsonSerializer = context.GetRequiredService(); - invokeParameters = jsonSerializer.Deserialize>(data); + invokeParameters = jsonSerializer.Deserialize>(data); } // 构造服务代理上下文 @@ -225,7 +230,7 @@ public class ServiceInvocationJob : IJobRunnable { // 直接调用 var taskProxy = (Task)DaprClientProxyMethod - .Invoke(clientProxy, new object[] { clientProxyRequestContext }); + .Invoke(clientProxy, new object[] { clientProxyRequestContext })!; await taskProxy; } else @@ -234,7 +239,7 @@ public class ServiceInvocationJob : IJobRunnable var returnType = serviceMethod.ReturnType.GenericTypeArguments[0]; var result = (Task)DaprCallRequestAsyncMethod .MakeGenericMethod(returnType) - .Invoke(this, new object[] { context }); + .Invoke(this, new object[] { context })!; context.SetResult(await GetResultAsync(result, returnType)); } @@ -265,6 +270,6 @@ public class ServiceInvocationJob : IJobRunnable .MakeGenericType(resultType) .GetProperty(nameof(Task.Result), BindingFlags.Instance | BindingFlags.Public); Check.NotNull(resultProperty, nameof(resultProperty)); - return resultProperty.GetValue(task); + return resultProperty.GetValue(task)!; } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/AbpBackgroundTasksQuartzModule.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/AbpBackgroundTasksQuartzModule.cs index 0d129a06f..da91db0e4 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/AbpBackgroundTasksQuartzModule.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/AbpBackgroundTasksQuartzModule.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; using Quartz; using Volo.Abp; using Volo.Abp.Modularity; @@ -10,6 +11,11 @@ namespace LINGYUN.Abp.BackgroundTasks.Quartz; [DependsOn(typeof(AbpQuartzModule))] public class AbpBackgroundTasksQuartzModule : AbpModule { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.Replace(ServiceDescriptor.Singleton()); + } + public override void OnApplicationInitialization(ApplicationInitializationContext context) { var _scheduler = context.ServiceProvider.GetRequiredService(); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/IQuartzJobCreator.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/IQuartzJobCreator.cs index c15c34c8d..4bedd02ba 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/IQuartzJobCreator.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/IQuartzJobCreator.cs @@ -4,9 +4,7 @@ namespace LINGYUN.Abp.BackgroundTasks.Quartz; public interface IQuartzJobCreator { -#nullable enable IJobDetail? CreateJob(JobInfo job); ITrigger? CreateTrigger(JobInfo job); -#nullable disable } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzCronValidator.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzCronValidator.cs new file mode 100644 index 000000000..de8ea6643 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzCronValidator.cs @@ -0,0 +1,17 @@ +using Quartz; +using System; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.BackgroundTasks.Quartz; + +public class QuartzCronValidator : ICronValidator +{ + public virtual Task ValidateAsync(string? cron) + { + if (cron.IsNullOrWhiteSpace()) + { + return Task.FromResult(false); + } + return Task.FromResult(CronExpression.IsValidExpression(cron)); + } +} diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobCreator.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobCreator.cs index 43f82c739..9dbd2f80a 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobCreator.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobCreator.cs @@ -26,7 +26,7 @@ public class QuartzJobCreator : IQuartzJobCreator, ISingletonDependency Logger = NullLogger.Instance; } - public IJobDetail CreateJob(JobInfo job) + public IJobDetail? CreateJob(JobInfo job) { var jobDefinition = JobDefinitionManager.GetOrNull(job.Type); var jobType = jobDefinition?.JobType ?? Type.GetType(job.Type); @@ -76,14 +76,14 @@ public class QuartzJobCreator : IQuartzJobCreator, ISingletonDependency return jobBuilder.Build(); } - public ITrigger CreateTrigger(JobInfo job) + public ITrigger? CreateTrigger(JobInfo job) { var triggerBuilder = TriggerBuilder.Create(); switch (job.JobType) { case JobType.Period: - if (!CronExpression.IsValidExpression(job.Cron)) + if (job.Cron.IsNullOrWhiteSpace() || !CronExpression.IsValidExpression(job.Cron)) { Logger.LogWarning($"The task: {job.Group} - {job.Name} periodic task Cron expression was invalid and the task trigger could not be created."); return null; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs index dec636421..e78935f66 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs @@ -93,7 +93,7 @@ public class QuartzJobListener : JobListenerSupport, ISingletonDependency } } - public override async Task JobWasExecuted(IJobExecutionContext context, JobExecutionException jobException, CancellationToken cancellationToken = default) + public override async Task JobWasExecuted(IJobExecutionContext context, JobExecutionException? jobException, CancellationToken cancellationToken = default) { try { diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobSearchJobAdapter.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobSearchJobAdapter.cs index a5fad3abf..53b32cd63 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobSearchJobAdapter.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobSearchJobAdapter.cs @@ -2,6 +2,7 @@ using Quartz; using System.Collections.Immutable; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Timing; namespace LINGYUN.Abp.BackgroundTasks.Quartz; @@ -22,6 +23,9 @@ public class QuartzJobSearchJobAdapter : IJob public async virtual Task Execute(IJobExecutionContext context) { var jobType = context.MergedJobDataMap.GetString(nameof(JobInfo.Type)); + + Check.NotNull(jobType, nameof(jobType)); + var jobDefinition = JobDefinitionManager.Get(jobType); using var scope = ServiceScopeFactory.CreateScope(); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/Quartz/IJobExecutionContextExtensions.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/Quartz/IJobExecutionContextExtensions.cs index cfcdf2be3..bb471905e 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/Quartz/IJobExecutionContextExtensions.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/Quartz/IJobExecutionContextExtensions.cs @@ -5,18 +5,18 @@ namespace Quartz; public static class IJobExecutionContextExtensions { - public static TValue GetData(this IJobExecutionContext context, string key) + public static TValue? GetData(this IJobExecutionContext context, string key) { var value = context.MergedJobDataMap.GetString(key); - return (TValue)Convert.ChangeType(value, typeof(TValue)); + return (TValue)Convert.ChangeType(value!, typeof(TValue)); } public static string GetString(this IJobExecutionContext context, string key) { var value = context.MergedJobDataMap.Get(key); - return value != null ? value.ToString() : ""; + return value != null ? value.ToString()! : ""; } public static int GetInt(this IJobExecutionContext context, string key) @@ -43,7 +43,7 @@ public static class IJobExecutionContextExtensions return false; } - public static bool TryGetCache(this IJobExecutionContext context, string key, out object value) + public static bool TryGetCache(this IJobExecutionContext context, string key, out object? value) { value = context.Get(key); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.TaskManagement/LINGYUN/Abp/BackgroundTasks/TaskManagement/TaskManagementJobPublisher.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.TaskManagement/LINGYUN/Abp/BackgroundTasks/TaskManagement/TaskManagementJobPublisher.cs index e1ff1f704..cc1364008 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.TaskManagement/LINGYUN/Abp/BackgroundTasks/TaskManagement/TaskManagementJobPublisher.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.TaskManagement/LINGYUN/Abp/BackgroundTasks/TaskManagement/TaskManagementJobPublisher.cs @@ -27,7 +27,7 @@ public class TaskManagementJobPublisher : IJobPublisher, ITransientDependency Cron = job.Cron, MaxCount = job.MaxCount, MaxTryCount = job.MaxTryCount, - Args = new ExtraPropertyDictionary(job.Args), + Args = new ExtraPropertyDictionary(job.Args!), BeginTime = job.BeginTime, Description = job.Description, EndTime = job.EndTime, diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundJobAdapter.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundJobAdapter.cs index 5fa086544..4ac027b1f 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundJobAdapter.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundJobAdapter.cs @@ -26,7 +26,7 @@ public class BackgroundJobAdapter : IJobRunnable public async virtual Task ExecuteAsync(JobRunnableContext context) { - object jobArgs = null; + object? jobArgs = null; if (context.TryGetString(nameof(TArgs), out var argsJson)) { var jsonSerializer = context.GetRequiredService(); @@ -38,7 +38,7 @@ public class BackgroundJobAdapter : IJobRunnable var jobContext = new JobExecutionContext( context.ServiceProvider, jobConfiguration.JobType, - jobArgs, + jobArgs!, context.CancellationToken); await JobExecuter.ExecuteAsync(jobContext); } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundJobManager.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundJobManager.cs index ded32941d..cb838e4c8 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundJobManager.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundJobManager.cs @@ -1,7 +1,6 @@ using Microsoft.Extensions.Options; using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Volo.Abp.BackgroundJobs; using Volo.Abp.Guids; @@ -59,9 +58,9 @@ public class BackgroundJobManager : IBackgroundJobManager var jobId = GuidGenerator.Create(); var jobArgs = new Dictionary { - { nameof(TArgs), JsonSerializer.Serialize(args) }, - { "ArgsType", jobConfiguration.ArgsType.AssemblyQualifiedName }, - { "JobType", jobConfiguration.JobType.AssemblyQualifiedName }, + { nameof(TArgs), JsonSerializer.Serialize(args!) }, + { "ArgsType", jobConfiguration.ArgsType.AssemblyQualifiedName! }, + { "JobType", jobConfiguration.JobType.AssemblyQualifiedName! }, { "JobName", jobConfiguration.JobName }, }; var jobInfo = new JobInfo @@ -80,14 +79,12 @@ public class BackgroundJobManager : IBackgroundJobManager // 确保不会被轮询入队 Status = JobStatus.None, NodeName = TasksOptions.NodeName, - Type = typeof(BackgroundJobAdapter).AssemblyQualifiedName, + Type = typeof(BackgroundJobAdapter).AssemblyQualifiedName!, }; if (TasksOptions.JobDispatcherSelectors.IsMatch(jobConfiguration.JobType)) { - var selector = TasksOptions - .JobDispatcherSelectors - .FirstOrDefault(x => x.Predicate(jobConfiguration.JobType)); + var selector = TasksOptions.JobDispatcherSelectors.GetJobTypeSelector(jobConfiguration.JobType); jobInfo.Interval = selector.Interval ?? jobInfo.Interval; jobInfo.LockTimeOut = selector.LockTimeOut ?? jobInfo.LockTimeOut; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundWorkerAdapter.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundWorkerAdapter.cs index 0f73f6e86..de4413157 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundWorkerAdapter.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundWorkerAdapter.cs @@ -12,8 +12,8 @@ namespace LINGYUN.Abp.BackgroundTasks; public class BackgroundWorkerAdapter : BackgroundWorkerBase, IBackgroundWorkerRunnable where TWorker : IBackgroundWorker { - private readonly MethodInfo _doWorkAsyncMethod; - private readonly MethodInfo _doWorkMethod; + private readonly MethodInfo? _doWorkAsyncMethod; + private readonly MethodInfo? _doWorkMethod; public BackgroundWorkerAdapter() { @@ -21,7 +21,6 @@ public class BackgroundWorkerAdapter : BackgroundWorkerBase, IBackgroun _doWorkMethod = typeof(TWorker).GetMethod("DoWork", BindingFlags.Instance | BindingFlags.NonPublic); } -#nullable enable public JobInfo? BuildWorker(IBackgroundWorker worker) { int? period; @@ -65,8 +64,8 @@ public class BackgroundWorkerAdapter : BackgroundWorkerBase, IBackgroun }; return new JobInfo { - Id = workerType.FullName, - Name = workerType.FullName, + Id = workerType.FullName!, + Name = workerType.FullName!, Group = "BackgroundWorkers", Priority = JobPriority.Normal, Source = JobSource.System, @@ -78,14 +77,13 @@ public class BackgroundWorkerAdapter : BackgroundWorkerBase, IBackgroun MaxTryCount = 10, // 确保不会被轮询入队 Status = JobStatus.None, - Type = typeof(BackgroundWorkerAdapter).AssemblyQualifiedName, + Type = typeof(BackgroundWorkerAdapter).AssemblyQualifiedName!, }; } -#nullable disable public async Task ExecuteAsync(JobRunnableContext context) { - var worker = (IBackgroundWorker)context.GetService(typeof(TWorker)); + var worker = context.GetService(typeof(TWorker)) as IBackgroundWorker; var workerContext = new PeriodicBackgroundWorkerContext(context.ServiceProvider, context.CancellationToken); switch (worker) @@ -94,7 +92,7 @@ public class BackgroundWorkerAdapter : BackgroundWorkerBase, IBackgroun { if (_doWorkAsyncMethod != null) { - await(Task)_doWorkAsyncMethod.Invoke(asyncWorker, new object[] { workerContext }); + await(Task)_doWorkAsyncMethod.Invoke(asyncWorker, new object[] { workerContext })!; } break; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundWorkerManager.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundWorkerManager.cs index 804bdda36..45e37fa74 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundWorkerManager.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/BackgroundWorkerManager.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.Options; using System; -using System.Linq; using System.Threading; using System.Threading.Tasks; using Volo.Abp.BackgroundWorkers; @@ -63,9 +62,7 @@ public class BackgroundWorkerManager : IBackgroundWorkerManager var workerType = ProxyHelper.GetUnProxiedType(worker); if (workerType != null && Options.JobDispatcherSelectors.IsMatch(workerType)) { - var selector = Options - .JobDispatcherSelectors - .FirstOrDefault(x => x.Predicate(workerType)); + var selector = Options.JobDispatcherSelectors.GetJobTypeSelector(workerType); jobInfo.Interval = selector.Interval ?? jobInfo.Interval; jobInfo.LockTimeOut = selector.LockTimeOut ?? jobInfo.LockTimeOut; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/CronNotNullValidator.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/CronNotNullValidator.cs new file mode 100644 index 000000000..b0228c71d --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/CronNotNullValidator.cs @@ -0,0 +1,14 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace LINGYUN.Abp.BackgroundTasks; + +[Dependency(TryRegister = true)] +public class CronNotNullValidator : ICronValidator, ISingletonDependency +{ + public Task ValidateAsync(string? cron) + { + return Task.FromResult(!cron.IsNullOrWhiteSpace()); + } +} diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/DefaultJobLockProvider.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/DefaultJobLockProvider.cs index db2657fe9..0d1d17ca6 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/DefaultJobLockProvider.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/DefaultJobLockProvider.cs @@ -25,11 +25,7 @@ public class DefaultJobLockProvider : IJobLockProvider, ISingletonDependency return Task.FromResult(true); } - jobLock = new JobLock - { - ExpirationTime = DateTime.UtcNow.AddSeconds(lockSeconds), - Semaphore = new SemaphoreSlim(1, 1) - }; + jobLock = new JobLock(DateTime.UtcNow.AddSeconds(lockSeconds), new SemaphoreSlim(1, 1)); return Task.FromResult(_localSyncObjects.TryAdd(jobKey, jobLock)); } @@ -52,5 +48,10 @@ public class DefaultJobLockProvider : IJobLockProvider, ISingletonDependency { public DateTime ExpirationTime { get; set; } public SemaphoreSlim Semaphore { get; set; } + public JobLock(DateTime expirationTime, SemaphoreSlim semaphore) + { + ExpirationTime = expirationTime; + Semaphore = semaphore; + } } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IBackgroundWorkerRunnable.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IBackgroundWorkerRunnable.cs index b1e53070a..b0158d142 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IBackgroundWorkerRunnable.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IBackgroundWorkerRunnable.cs @@ -1,11 +1,8 @@ -using System.Threading; -using Volo.Abp.BackgroundWorkers; +using Volo.Abp.BackgroundWorkers; namespace LINGYUN.Abp.BackgroundTasks; public interface IBackgroundWorkerRunnable : IJobRunnable { -#nullable enable JobInfo? BuildWorker(IBackgroundWorker worker); -#nullable disable } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/ICronValidator.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/ICronValidator.cs new file mode 100644 index 000000000..a4270b3ab --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/ICronValidator.cs @@ -0,0 +1,8 @@ +using System.Threading.Tasks; + +namespace LINGYUN.Abp.BackgroundTasks; + +public interface ICronValidator +{ + Task ValidateAsync(string? cron); +} diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IJobDispatcher.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IJobDispatcher.cs index 86525f478..696062028 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IJobDispatcher.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IJobDispatcher.cs @@ -29,7 +29,7 @@ public interface IJobDispatcher /// Task DispatchAsync( IEnumerable jobs, - string nodeName = null, + string? nodeName = null, Guid? tenantId = null, CancellationToken cancellationToken = default); /// diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IJobStore.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IJobStore.cs index f4dd712dd..9572e2f59 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IJobStore.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/IJobStore.cs @@ -9,7 +9,7 @@ public interface IJobStore { Task> GetRuningListAsync( int maxResultCount, - string nodeName = null, + string? nodeName = null, CancellationToken cancellationToken = default); Task> GetWaitingListAsync( @@ -19,7 +19,7 @@ public interface IJobStore Task> GetAllPeriodTasksAsync( CancellationToken cancellationToken = default); - Task FindAsync( + Task FindAsync( string jobId, CancellationToken cancellationToken = default); @@ -36,6 +36,6 @@ public interface IJobStore Task> CleanupAsync( int maxResultCount, TimeSpan jobExpiratime, - string nodeName = null, + string? nodeName = null, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/DefaultBackgroundWorker.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/DefaultBackgroundWorker.cs index 61c00ad36..ba8d15c82 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/DefaultBackgroundWorker.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/DefaultBackgroundWorker.cs @@ -77,7 +77,7 @@ internal class DefaultBackgroundWorker : BackgroundService Source = JobSource.System, LockTimeOut = _options.JobFetchLockTimeOut, NodeName = _options.NodeName, - Type = typeof(BackgroundPollingJob).AssemblyQualifiedName, + Type = typeof(BackgroundPollingJob).AssemblyQualifiedName!, }; } @@ -98,7 +98,7 @@ internal class DefaultBackgroundWorker : BackgroundService Priority = JobPriority.High, Source = JobSource.System, NodeName = _options.NodeName, - Type = typeof(BackgroundCleaningJob).AssemblyQualifiedName, + Type = typeof(BackgroundCleaningJob).AssemblyQualifiedName!, }; } @@ -120,7 +120,7 @@ internal class DefaultBackgroundWorker : BackgroundService Priority = JobPriority.High, Source = JobSource.System, NodeName = _options.NodeName, - Type = typeof(BackgroundCheckingJob).AssemblyQualifiedName, + Type = typeof(BackgroundCheckingJob).AssemblyQualifiedName!, }; } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/InMemoryJobStore.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/InMemoryJobStore.cs index 4725c79b2..90b8e1995 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/InMemoryJobStore.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/InMemoryJobStore.cs @@ -34,7 +34,7 @@ internal class InMemoryJobStore : IJobStore, ISingletonDependency return Task.FromResult(jobs); } - public virtual Task> GetRuningListAsync(int maxResultCount, string nodeName = null, CancellationToken cancellationToken = default) + public virtual Task> GetRuningListAsync(int maxResultCount, string? nodeName = null, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); @@ -68,14 +68,14 @@ internal class InMemoryJobStore : IJobStore, ISingletonDependency return Task.FromResult(jobs); } - public Task FindAsync( + public Task FindAsync( string jobId, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); var job = _memoryJobStore.FirstOrDefault(x => x.Id.Equals(jobId)); - return Task.FromResult(job); + return Task.FromResult(job); } public virtual Task StoreAsync( @@ -133,7 +133,7 @@ internal class InMemoryJobStore : IJobStore, ISingletonDependency public virtual Task> CleanupAsync( int maxResultCount, TimeSpan jobExpiratime, - string nodeName = null, + string? nodeName = null, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/JobEventProvider.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/JobEventProvider.cs index b0e6e5da2..6bf64149d 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/JobEventProvider.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/Internal/JobEventProvider.cs @@ -36,6 +36,6 @@ internal class JobEventProvider : IJobEventProvider, ISingletonDependency .Select(p => _serviceProvider.GetRequiredService(p) as IJobEvent) .ToList(); - return jobEvents; + return jobEvents!; } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/JobDispatcherSelectorListExtensions.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/JobDispatcherSelectorListExtensions.cs index 9beffaa4b..a7fb2144d 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/JobDispatcherSelectorListExtensions.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/JobDispatcherSelectorListExtensions.cs @@ -18,7 +18,7 @@ public static class JobDispatcherSelectorListExtensions /// /// Tips: 仅作用于适用于 接口的作业预配置 /// - public static void AddJob([NotNull] this IJobDispatcherSelectorList selectors, [CanBeNull] Action setup = null) + public static void AddJob([NotNull] this IJobDispatcherSelectorList selectors, [CanBeNull] Action? setup = null) { Check.NotNull(selectors, nameof(selectors)); @@ -52,7 +52,7 @@ public static class JobDispatcherSelectorListExtensions /// /// Tips: 仅作用于适用于 接口的作业预配置 /// - public static void AddWorker([NotNull] this IJobDispatcherSelectorList selectors, [CanBeNull] Action setup = null) + public static void AddWorker([NotNull] this IJobDispatcherSelectorList selectors, [CanBeNull] Action? setup = null) where TWorker : IBackgroundWorker { Check.NotNull(selectors, nameof(selectors)); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/JobRunnableExecuter.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/JobRunnableExecuter.cs index ae3d8ac7d..db966f381 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/JobRunnableExecuter.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/JobRunnableExecuter.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; @@ -22,13 +23,13 @@ public class JobRunnableExecuter : IJobRunnableExecuter, ITransientDependency } } - private async Task InternalExecuteAsync(JobRunnableContext context) + private async static Task InternalExecuteAsync(JobRunnableContext context) { - var jobRunnable = context.ServiceProvider.GetService(context.JobType); - if (jobRunnable == null) - { - jobRunnable = Activator.CreateInstance(context.JobType); - } + var jobRunnable = context.ServiceProvider.GetService(context.JobType) + ?? Activator.CreateInstance(context.JobType); + + Check.NotNull(jobRunnable, nameof(jobRunnable)); + await ((IJobRunnable)jobRunnable).ExecuteAsync(context); } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/NullJobDispatcher.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/NullJobDispatcher.cs index 4dd9b041d..ee37b1551 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/NullJobDispatcher.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN/Abp/BackgroundTasks/NullJobDispatcher.cs @@ -17,7 +17,7 @@ public class NullJobDispatcher : IJobDispatcher, ISingletonDependency public Task DispatchAsync( IEnumerable jobs, - string nodeName = null, + string? nodeName = null, Guid? tenantId = null, CancellationToken cancellationToken = default) { diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Identity.Jobs/LINGYUN/Abp/Identity/Jobs/InactiveIdentityUserCleanupJob.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.Identity.Jobs/LINGYUN/Abp/Identity/Jobs/InactiveIdentityUserCleanupJob.cs index 69055d319..f58214a27 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Identity.Jobs/LINGYUN/Abp/Identity/Jobs/InactiveIdentityUserCleanupJob.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Identity.Jobs/LINGYUN/Abp/Identity/Jobs/InactiveIdentityUserCleanupJob.cs @@ -145,7 +145,7 @@ public class InactiveIdentityUserCleanupJob : IJobRunnable async (inactiveUser, ctx) => { var inactivityDays = (int)(clock.Now - (inactiveUser.LastSignInTime ?? inactiveUser.CreationTime)).TotalDays; - var notificationTemplateData = new Dictionary + var notificationTemplateData = new Dictionary { { "now", clock.Now }, { "name", inactiveUser.Name }, diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Identity.Jobs/LINGYUN/Abp/Identity/Jobs/InactiveIdentityUserNotifierJob.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.Identity.Jobs/LINGYUN/Abp/Identity/Jobs/InactiveIdentityUserNotifierJob.cs index 1998ef196..caf337fa6 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Identity.Jobs/LINGYUN/Abp/Identity/Jobs/InactiveIdentityUserNotifierJob.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Identity.Jobs/LINGYUN/Abp/Identity/Jobs/InactiveIdentityUserNotifierJob.cs @@ -149,7 +149,7 @@ public class InactiveIdentityUserNotifierJob : IJobRunnable context.CancellationToken, async (inactiveUser, ctx) => { - var notificationTemplateData = new Dictionary + var notificationTemplateData = new Dictionary { { "now", clock.Now }, { "loginUrl", userLoginUri }, diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.PostgresSqlInstaller/LINGYUN/Abp/Quartz/PostgresSqlInstaller/PostgresSqlQuartzSqlInstaller.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.PostgresSqlInstaller/LINGYUN/Abp/Quartz/PostgresSqlInstaller/PostgresSqlQuartzSqlInstaller.cs index e2822b04c..f38c7c77d 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.PostgresSqlInstaller/LINGYUN/Abp/Quartz/PostgresSqlInstaller/PostgresSqlQuartzSqlInstaller.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.PostgresSqlInstaller/LINGYUN/Abp/Quartz/PostgresSqlInstaller/PostgresSqlQuartzSqlInstaller.cs @@ -66,7 +66,7 @@ public class PostgresSqlQuartzSqlInstaller : IQuartzSqlInstaller var builder = new NpgsqlConnectionStringBuilder(connectionString); - var dataBaseName = await CreateDataBaseIfNotExists(builder.Database, builder); + var dataBaseName = await CreateDataBaseIfNotExists(builder.Database!, builder); builder.Database = dataBaseName; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerModule.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerModule.cs index 6363b4bd3..522616257 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerModule.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlInstaller/LINGYUN/Abp/Quartz/SqlInstaller/AbpQuartzSqlInstallerModule.cs @@ -24,7 +24,10 @@ public class AbpQuartzSqlInstallerModule : AbpModule { foreach (var settingKey in abpQuartzOptions.Properties.AllKeys) { - options[settingKey] = abpQuartzOptions.Properties[settingKey]; + if (!string.IsNullOrWhiteSpace(settingKey)) + { + options[settingKey] = abpQuartzOptions.Properties[settingKey]; + } } if (abpQuartzOptions.Properties[StdSchedulerFactory.PropertyJobStoreType] == null) @@ -43,14 +46,17 @@ public class AbpQuartzSqlInstallerModule : AbpModule if (configuration.GetValue("Quartz:UsePersistentStore", false)) { var driverDelegateType = configuration[$"Quartz:Properties:quartz.jobStore.driverDelegateType"]; - // 初始化 Quartz 数据库 - var installs = context.ServiceProvider.GetServices(); - - foreach (var install in installs) + if (!string.IsNullOrWhiteSpace(driverDelegateType)) { - if (install.CanInstall(driverDelegateType)) + // 初始化 Quartz 数据库 + var installs = context.ServiceProvider.GetServices(); + + foreach (var install in installs) { - await install.InstallAsync(); + if (install.CanInstall(driverDelegateType)) + { + await install.InstallAsync(); + } } } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/SqlServerQuartzSqlInstaller.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/SqlServerQuartzSqlInstaller.cs index ceffd379a..4be4ba670 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/SqlServerQuartzSqlInstaller.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Quartz.SqlServerInstaller/LINGYUN/Abp/Quartz/SqlServerInstaller/SqlServerQuartzSqlInstaller.cs @@ -9,7 +9,6 @@ using System.Collections.Generic; using System.Data; using System.Linq; using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; using Volo.Abp.Quartz; using Volo.Abp.VirtualFileSystem; using static Quartz.SchedulerBuilder; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionCreateDto.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionCreateDto.cs index 7cc846c80..9aa6019bc 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionCreateDto.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionCreateDto.cs @@ -10,5 +10,5 @@ public class BackgroundJobActionCreateDto : BackgroundJobActionCreateOrUpdateDto /// [Required] [DynamicStringLength(typeof(BackgroundJobActionConsts), nameof(BackgroundJobActionConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionDefinitionDto.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionDefinitionDto.cs index 946684def..51701c44d 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionDefinitionDto.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionDefinitionDto.cs @@ -8,7 +8,7 @@ public class BackgroundJobActionDefinitionDto /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 类型 /// @@ -16,13 +16,13 @@ public class BackgroundJobActionDefinitionDto /// /// 显示名称 /// - public string DisplayName { get; set; } + public string? DisplayName { get; set; } /// /// 描述 /// - public string Description { get; set; } + public string? Description { get; set; } /// /// 参数列表 /// - public IList Paramters { get; set; } + public IList Paramters { get; set; } = new List(); } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionDto.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionDto.cs index 6f006fd53..d4fc78ba2 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionDto.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionDto.cs @@ -9,11 +9,11 @@ public class BackgroundJobActionDto : EntityDto /// /// 作业标识 /// - public string JobId { get; set; } + public string JobId { get; set; } = default!; /// /// 名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 是否启用 /// @@ -21,5 +21,5 @@ public class BackgroundJobActionDto : EntityDto /// /// 参数 /// - public ExtraPropertyDictionary Paramters { get; set; } + public ExtraPropertyDictionary Paramters { get; set; } = new ExtraPropertyDictionary(); } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionParamterDto.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionParamterDto.cs index fcf6f8254..3c66ca1c6 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionParamterDto.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobActionParamterDto.cs @@ -2,8 +2,8 @@ public class BackgroundJobActionParamterDto { - public string Name { get; set; } + public string Name { get; set; } = default!; public bool Required { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } + public string? DisplayName { get; set; } + public string? Description { get; set; } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoCreateDto.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoCreateDto.cs index 2706086d6..ae4b2f9b0 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoCreateDto.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoCreateDto.cs @@ -12,22 +12,22 @@ public class BackgroundJobInfoCreateDto : BackgroundJobInfoCreateOrUpdateDto /// [Required] [DynamicStringLength(typeof(BackgroundJobInfoConsts), nameof(BackgroundJobInfoConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 任务分组 /// [Required] [DynamicStringLength(typeof(BackgroundJobInfoConsts), nameof(BackgroundJobInfoConsts.MaxGroupLength))] - public string Group { get; set; } + public string Group { get; set; } = default!; /// /// 任务类型 /// [Required] [DynamicStringLength(typeof(BackgroundJobInfoConsts), nameof(BackgroundJobInfoConsts.MaxTypeLength))] - public string Type { get; set; } + public string Type { get; set; } = default!; [DynamicStringLength(typeof(BackgroundJobInfoConsts), nameof(BackgroundJobInfoConsts.MaxNodeNameLength))] - public string NodeName { get; set; } + public string? NodeName { get; set; } /// /// 开始时间 /// diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoCreateOrUpdateDto.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoCreateOrUpdateDto.cs index 3d3eb804f..6a4764fb9 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoCreateOrUpdateDto.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoCreateOrUpdateDto.cs @@ -1,5 +1,4 @@ using LINGYUN.Abp.BackgroundTasks; -using System; using Volo.Abp.Data; using Volo.Abp.Validation; @@ -14,12 +13,12 @@ public abstract class BackgroundJobInfoCreateOrUpdateDto /// /// 任务参数 /// - public ExtraPropertyDictionary Args { get; set; } + public ExtraPropertyDictionary Args { get; set; } = new ExtraPropertyDictionary(); /// /// 描述 /// [DynamicStringLength(typeof(BackgroundJobInfoConsts), nameof(BackgroundJobInfoConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } /// /// 任务类别 /// @@ -28,7 +27,7 @@ public abstract class BackgroundJobInfoCreateOrUpdateDto /// Cron表达式,如果是持续任务需要指定 /// [DynamicStringLength(typeof(BackgroundJobInfoConsts), nameof(BackgroundJobInfoConsts.MaxCronLength))] - public string Cron { get; set; } + public string? Cron { get; set; } /// /// 失败重试上限 /// 默认:50 diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoDto.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoDto.cs index f4027627b..6bf0022d6 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoDto.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoDto.cs @@ -12,23 +12,23 @@ public class BackgroundJobInfoDto : ExtensibleAuditedEntityDto, IHasConc /// /// 任务名称 /// - public string Name { get; set; } + public string Name { get; set; } = default!; /// /// 任务分组 /// - public string Group { get; set; } + public string Group { get; set; } = default!; /// /// 任务类型 /// - public string Type { get; set; } + public string Type { get; set; } = default!; /// /// 返回参数 /// - public string Result { get; set; } + public string? Result { get; set; } /// /// 任务参数 /// - public ExtraPropertyDictionary Args { get; set; } + public ExtraPropertyDictionary Args { get; set; } = new ExtraPropertyDictionary(); /// /// 任务状态 /// @@ -36,7 +36,7 @@ public class BackgroundJobInfoDto : ExtensibleAuditedEntityDto, IHasConc /// /// 描述 /// - public string Description { get; set; } + public string? Description { get; set; } /// /// 开始时间 /// @@ -60,7 +60,7 @@ public class BackgroundJobInfoDto : ExtensibleAuditedEntityDto, IHasConc /// /// Cron表达式,如果是持续任务需要指定 /// - public string Cron { get; set; } + public string? Cron { get; set; } /// /// 触发次数 /// @@ -108,5 +108,5 @@ public class BackgroundJobInfoDto : ExtensibleAuditedEntityDto, IHasConc /// /// 指定作业运行节点 /// - public string NodeName { get; set; } + public string? NodeName { get; set; } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoGetListInput.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoGetListInput.cs index beb76ae92..254fafd74 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoGetListInput.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoGetListInput.cs @@ -9,19 +9,19 @@ public class BackgroundJobInfoGetListInput: PagedAndSortedResultRequestDto /// /// 其他过滤条件 /// - public string Filter { get; set; } + public string? Filter { get; set; } /// /// 任务名称 /// - public string Name { get; set; } + public string? Name { get; set; } /// /// 任务分组 /// - public string Group { get; set; } + public string? Group { get; set; } /// /// 任务类型 /// - public string Type { get; set; } + public string? Type { get; set; } /// /// 任务状态 /// diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoUpdateDto.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoUpdateDto.cs index 17279a3b1..1bf291e01 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoUpdateDto.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoUpdateDto.cs @@ -4,5 +4,5 @@ namespace LINGYUN.Abp.TaskManagement; public class BackgroundJobInfoUpdateDto : BackgroundJobInfoCreateOrUpdateDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobLogDto.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobLogDto.cs index 3411c5e9a..c6cfabff9 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobLogDto.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobLogDto.cs @@ -5,10 +5,10 @@ namespace LINGYUN.Abp.TaskManagement; public class BackgroundJobLogDto : EntityDto { - public string JobName { get; set; } - public string JobGroup { get; set; } - public string JobType { get; set; } - public string Message { get; set; } + public string? JobName { get; set; } + public string? JobGroup { get; set; } + public string? JobType { get; set; } + public string? Message { get; set; } public DateTime RunTime { get; set; } - public string Exception { get; set; } + public string? Exception { get; set; } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobLogGetListInput.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobLogGetListInput.cs index aef36dcf7..1697e1e84 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobLogGetListInput.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobLogGetListInput.cs @@ -5,11 +5,11 @@ namespace LINGYUN.Abp.TaskManagement; public class BackgroundJobLogGetListInput : PagedAndSortedResultRequestDto { - public string JobId { get; set; } + public string? JobId { get; set; } /// /// 其他过滤条件 /// - public string Filter { get; set; } + public string? Filter { get; set; } /// /// 存在异常 /// @@ -17,15 +17,15 @@ public class BackgroundJobLogGetListInput : PagedAndSortedResultRequestDto /// /// 任务名称 /// - public string Name { get; set; } + public string? Name { get; set; } /// /// 任务分组 /// - public string Group { get; set; } + public string? Group { get; set; } /// /// 任务类型 /// - public string Type { get; set; } + public string? Type { get; set; } /// /// 开始触发时间 /// diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobParamterDto.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobParamterDto.cs index bcc15dcd7..886ee6bdf 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobParamterDto.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobParamterDto.cs @@ -2,11 +2,11 @@ public class BackgroundJobParamterDto { - public string Name { get; set; } + public string Name { get; set; } = default!; public bool Required { get; set; } - public string DisplayName { get; set; } + public string? DisplayName { get; set; } - public string Description { get; set; } + public string? Description { get; set; } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN/Abp/TaskManagement/BackgroundJobActionAppService.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN/Abp/TaskManagement/BackgroundJobActionAppService.cs index 8771c23a9..19f9d3724 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN/Abp/TaskManagement/BackgroundJobActionAppService.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN/Abp/TaskManagement/BackgroundJobActionAppService.cs @@ -42,7 +42,7 @@ public class BackgroundJobActionAppService : TaskManagementApplicationService, I action = await BackgroundJobActionRepository.InsertAsync(action); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(action); } @@ -53,7 +53,7 @@ public class BackgroundJobActionAppService : TaskManagementApplicationService, I await BackgroundJobActionRepository.DeleteAsync(action); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task> GetActionsAsync(string jobId) @@ -70,20 +70,36 @@ public class BackgroundJobActionAppService : TaskManagementApplicationService, I var dtoList = actionDefinitions - .WhereIf(input.Type.HasValue, action => action.Type == input.Type.Value) - .Select(action => new BackgroundJobActionDefinitionDto + .WhereIf(input.Type.HasValue, action => action.Type == input.Type) + .Select(action => { - Name = action.Name, - Type = action.Type, - DisplayName = action.DisplayName.Localize(StringLocalizerFactory), - Description = action.Description?.Localize(StringLocalizerFactory), - Paramters = action.Paramters.Select(p => new BackgroundJobActionParamterDto + var backgroundJob = new BackgroundJobActionDefinitionDto { - Name = p.Name, - Required = p.Required, - DisplayName = p.DisplayName.Localize(StringLocalizerFactory), - Description = p.Description?.Localize(StringLocalizerFactory), - }).ToList(), + Name = action.Name, + Type = action.Type, + DisplayName = action.DisplayName.Localize(StringLocalizerFactory), + Paramters = action.Paramters.Select(p => + { + var backgroundJobActionParamter = new BackgroundJobActionParamterDto + { + Name = p.Name, + Required = p.Required, + DisplayName = p.DisplayName.Localize(StringLocalizerFactory), + }; + if (p.Description != null) + { + backgroundJobActionParamter.Description = p.Description.Localize(StringLocalizerFactory); + } + + return backgroundJobActionParamter; + }).ToList(), + }; + if (action.Description != null) + { + backgroundJob.Description = action.Description.Localize(StringLocalizerFactory); + } + + return backgroundJob; }).ToList(); return Task.FromResult(new ListResultDto(dtoList)); @@ -98,7 +114,7 @@ public class BackgroundJobActionAppService : TaskManagementApplicationService, I action = await BackgroundJobActionRepository.UpdateAsync(action); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return ObjectMapper.Map(action); } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN/Abp/TaskManagement/BackgroundJobInfoAppService.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN/Abp/TaskManagement/BackgroundJobInfoAppService.cs index 5ad7da610..1091cd650 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN/Abp/TaskManagement/BackgroundJobInfoAppService.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN/Abp/TaskManagement/BackgroundJobInfoAppService.cs @@ -20,16 +20,19 @@ namespace LINGYUN.Abp.TaskManagement; public class BackgroundJobInfoAppService : DynamicQueryableAppService, IBackgroundJobInfoAppService { protected AbpBackgroundTasksOptions Options { get; } + protected ICronValidator CronValidator { get; } protected BackgroundJobManager BackgroundJobManager { get; } protected IJobDefinitionManager JobDefinitionManager { get; } protected IBackgroundJobInfoRepository BackgroundJobInfoRepository { get; } public BackgroundJobInfoAppService( + ICronValidator cronValidator, BackgroundJobManager backgroundJobManager, IJobDefinitionManager jobDefinitionManager, IBackgroundJobInfoRepository backgroundJobInfoRepository, IOptions options) { + CronValidator = cronValidator; BackgroundJobManager = backgroundJobManager; JobDefinitionManager = jobDefinitionManager; BackgroundJobInfoRepository = backgroundJobInfoRepository; @@ -53,19 +56,28 @@ public class BackgroundJobInfoAppService : DynamicQueryableAppService(backgroundJobInfo); } @@ -219,7 +231,7 @@ public class BackgroundJobInfoAppService : DynamicQueryableAppService> expression = _ => true; return expression - .AndIf(!Input.JobId.IsNullOrWhiteSpace(), x => x.JobId.Equals(Input.JobId)) - .AndIf(!Input.Type.IsNullOrWhiteSpace(), x => x.JobType.Contains(Input.Type)) - .AndIf(!Input.Group.IsNullOrWhiteSpace(), x => x.JobGroup.Equals(Input.Group)) - .AndIf(!Input.Name.IsNullOrWhiteSpace(), x => x.JobName.Equals(Input.Name)) - .AndIf(!Input.Filter.IsNullOrWhiteSpace(), x => x.JobName.Contains(Input.Filter) || - x.JobGroup.Contains(Input.Filter) || x.JobType.Contains(Input.Filter) || x.Message.Contains(Input.Filter)) + .AndIf(!Input.JobId.IsNullOrWhiteSpace(), x => x.JobId == Input.JobId) + .AndIf(!Input.Type.IsNullOrWhiteSpace(), x => x.JobType!.Contains(Input.Type!)) + .AndIf(!Input.Group.IsNullOrWhiteSpace(), x => x.JobGroup == Input.Group) + .AndIf(!Input.Name.IsNullOrWhiteSpace(), x => x.JobName == Input.Name) + .AndIf(!Input.Filter.IsNullOrWhiteSpace(), x => x.JobName!.Contains(Input.Filter!) || + x.JobGroup!.Contains(Input.Filter!) || x.JobType!.Contains(Input.Filter!) || x.Message!.Contains(Input.Filter!)) .AndIf(Input.HasExceptions.HasValue, x => !string.IsNullOrWhiteSpace(x.Exception)) .AndIf(Input.BeginRunTime.HasValue, x => x.RunTime >= Input.BeginRunTime) .AndIf(Input.EndRunTime.HasValue, x => x.RunTime <= Input.EndRunTime); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/BackgroundJobEto.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/BackgroundJobEto.cs index 51322c39d..5016a7a3b 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/BackgroundJobEto.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/BackgroundJobEto.cs @@ -9,11 +9,11 @@ namespace LINGYUN.Abp.TaskManagement; [EventName("abp.tkm.background-job")] public class BackgroundJobEto : IMultiTenant { - public string Id { get; set; } + public string Id { get; set; } = default!; public Guid? TenantId { get; set; } public bool IsEnabled { get; set; } - public string Name { get; set; } - public string Group { get; set; } - public string NodeName { get; set; } + public string Name { get; set; } = default!; + public string Group { get; set; } = default!; + public string? NodeName { get; set; } public JobStatus Status { get; set; } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/Localization/Resources/en.json b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/Localization/Resources/en.json index b9ec11035..36828a0ca 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/Localization/Resources/en.json +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/Localization/Resources/en.json @@ -18,6 +18,7 @@ "TaskManagement:01000": "A job named {Name} already exists in the Group {Group}!", "TaskManagement:01001": "The queue did not find the job named {Name} in Group {Group}. Please join the job first!", "TaskManagement:01002": "The job to be deleted contains an ongoing job. Please stop the job first and then try to delete it again!", + "TaskManagement:01003": "Invalid CRON expression: [{Cron}]!", "DisplayName:IsEnabled": "IsEnabled", "DisplayName:Group": "Group", "DisplayName:Name": "Name", diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/Localization/Resources/zh-Hans.json b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/Localization/Resources/zh-Hans.json index 087a5ac62..9260c0fab 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/Localization/Resources/zh-Hans.json @@ -18,6 +18,7 @@ "TaskManagement:01000": "分组 {Group} 中已经存在一个名称为 {Name} 的作业!", "TaskManagement:01001": "队列没有找到分组 {Group} 中名称为 {Name} 的作业, 请先将作业入队!", "TaskManagement:01002": "即将删除的作业中包含未停止作业,请先停止作业运行后再次尝试删除作业!", + "TaskManagement:01003": "无效的CRON表达式: [{Cron}]!", "DisplayName:IsEnabled": "是否启用", "DisplayName:Group": "分组", "DisplayName:Name": "名称", diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/TaskManagementErrorCodes.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/TaskManagementErrorCodes.cs index 1eb807788..77bc8e5ed 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/TaskManagementErrorCodes.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN/Abp/TaskManagement/TaskManagementErrorCodes.cs @@ -15,5 +15,9 @@ /// 仅允许删除已停止作业 /// public const string OnlyDeletionOfStopJobsIsAllowed = Namespace + ":01002"; + /// + /// 无效的CRON表达式: {Cron}! + /// + public const string InvalidCronExpression = Namespace + ":01003"; } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobAction.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobAction.cs index 0b78dd1ce..89789b054 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobAction.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobAction.cs @@ -13,11 +13,11 @@ public class BackgroundJobAction : AuditedAggregateRoot, IMultiTenant /// /// 作业标识 /// - public virtual string JobId { get; protected set; } + public virtual string JobId { get; protected set; } = default!; /// /// 名称 /// - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; /// /// 是否启用 /// @@ -25,7 +25,7 @@ public class BackgroundJobAction : AuditedAggregateRoot, IMultiTenant /// /// 参数 /// - public virtual ExtraPropertyDictionary Paramters { get; set; } + public virtual ExtraPropertyDictionary Paramters { get; set; } = default!; protected BackgroundJobAction() { } @@ -33,7 +33,7 @@ public class BackgroundJobAction : AuditedAggregateRoot, IMultiTenant Guid id, string jobId, string name, - IDictionary paramters, + IDictionary paramters, Guid? tenantId = null) : base(id) { JobId = Check.NotNullOrWhiteSpace(jobId, nameof(jobId), BackgroundJobActionConsts.MaxJobIdLength); @@ -43,6 +43,9 @@ public class BackgroundJobAction : AuditedAggregateRoot, IMultiTenant IsEnabled = true; Paramters = new ExtraPropertyDictionary(); - Paramters.AddIfNotContains(paramters); + foreach (var paramter in paramters) + { + Paramters[paramter.Key] = paramter.Value; + } } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfo.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfo.cs index ae02d8b4e..c77aafa25 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfo.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfo.cs @@ -14,23 +14,23 @@ public class BackgroundJobInfo : AuditedAggregateRoot, IMultiTenant /// /// 任务名称 /// - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } = default!; /// /// 任务分组 /// - public virtual string Group { get; protected set; } + public virtual string Group { get; protected set; } = default!; /// /// 任务类型 /// - public virtual string Type { get; protected set; } + public virtual string Type { get; protected set; } = default!; /// /// 上一次执行结果 /// - public virtual string Result { get; protected set; } + public virtual string? Result { get; protected set; } /// /// 任务参数 /// - public virtual ExtraPropertyDictionary Args { get; set; } + public virtual ExtraPropertyDictionary Args { get; set; } = default!; /// /// 任务状态 /// @@ -42,7 +42,7 @@ public class BackgroundJobInfo : AuditedAggregateRoot, IMultiTenant /// /// 描述 /// - public virtual string Description { get; set; } + public virtual string? Description { get; set; } /// /// 任务独占超时时长(秒) /// 0或更小不生效 @@ -71,7 +71,7 @@ public class BackgroundJobInfo : AuditedAggregateRoot, IMultiTenant /// /// Cron表达式,如果是持续任务需要指定 /// - public virtual string Cron { get; protected set; } + public virtual string? Cron { get; protected set; } /// /// 作业来源 /// @@ -110,7 +110,7 @@ public class BackgroundJobInfo : AuditedAggregateRoot, IMultiTenant /// /// 指定作业运行节点 /// - public virtual string NodeName { get; protected set; } + public virtual string? NodeName { get; protected set; } protected BackgroundJobInfo() { } public BackgroundJobInfo( @@ -118,14 +118,14 @@ public class BackgroundJobInfo : AuditedAggregateRoot, IMultiTenant string name, string group, string type, - IDictionary args, + IDictionary args, DateTime beginTime, DateTime? endTime = null, JobPriority priority = JobPriority.Normal, JobSource source = JobSource.None, int maxCount = 0, int maxTryCount = 50, - string nodeName = null, + string? nodeName = null, Guid? tenantId = null) : base(id) { Name = Check.NotNullOrWhiteSpace(name, nameof(name), BackgroundJobInfoConsts.MaxNameLength); @@ -148,7 +148,10 @@ public class BackgroundJobInfo : AuditedAggregateRoot, IMultiTenant Args = new ExtraPropertyDictionary(); if (args != null) { - Args.AddIfNotContains(args); + foreach (var arg in args) + { + Args[arg.Key] = arg.Value; + } } } @@ -180,7 +183,7 @@ public class BackgroundJobInfo : AuditedAggregateRoot, IMultiTenant NextRunTime = nextRunTime; } - public void SetResult(string result) + public void SetResult(string? result) { if (result.IsNullOrWhiteSpace()) { diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoExtensions.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoExtensions.cs index 2cb430dc6..6e03d541f 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoExtensions.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoExtensions.cs @@ -11,7 +11,7 @@ public static class BackgroundJobInfoEbackgroundJobInfotensions TenantId = backgroundJobInfo.TenantId, Name = backgroundJobInfo.Name, NextRunTime = backgroundJobInfo.NextRunTime, - Args = backgroundJobInfo.Args, + Args = backgroundJobInfo.Args!, IsAbandoned = backgroundJobInfo.IsAbandoned, BeginTime = backgroundJobInfo.BeginTime, EndTime = backgroundJobInfo.EndTime, diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoFilter.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoFilter.cs index 91453f508..d550504d9 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoFilter.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoFilter.cs @@ -11,23 +11,23 @@ public class BackgroundJobInfoFilter /// /// 其他过滤条件 /// - public string Filter { get; set; } + public string? Filter { get; set; } /// /// 任务名称 /// - public string Name { get; set; } + public string? Name { get; set; } /// /// 任务分组 /// - public string Group { get; set; } + public string? Group { get; set; } /// /// 任务类型 /// - public string Type { get; set; } + public string? Type { get; set; } /// /// 节点名称 /// - public string NodeName { get; set; } + public string? NodeName { get; set; } /// /// 任务状态 /// diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoSpecification.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoSpecification.cs index 3d2c5e115..be80bf6e4 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoSpecification.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobInfoSpecification.cs @@ -17,16 +17,16 @@ public class BackgroundJobInfoSpecification : Specification return expression .AndIf(!Filter.NodeName.IsNullOrWhiteSpace(), x => x.NodeName == Filter.NodeName) - .AndIf(!Filter.Type.IsNullOrWhiteSpace(), x => x.Type.Contains(Filter.Type)) + .AndIf(!Filter.Type.IsNullOrWhiteSpace(), x => x.Type.Contains(Filter.Type!)) .AndIf(!Filter.Group.IsNullOrWhiteSpace(), x => x.Group.Equals(Filter.Group)) .AndIf(!Filter.Name.IsNullOrWhiteSpace(), x => x.Name.Equals(Filter.Name)) - .AndIf(!Filter.Filter.IsNullOrWhiteSpace(), x => x.Name.Contains(Filter.Filter) || - x.Group.Contains(Filter.Filter) || x.Type.Contains(Filter.Filter) || x.Description.Contains(Filter.Filter)) + .AndIf(!Filter.Filter.IsNullOrWhiteSpace(), x => x.Name.Contains(Filter.Filter!) || + x.Group.Contains(Filter.Filter!) || x.Type.Contains(Filter.Filter!) || x.Description!.Contains(Filter.Filter!)) .AndIf(Filter.JobType.HasValue, x => x.JobType == Filter.JobType) - .AndIf(Filter.Status.HasValue, x => x.Status == Filter.Status.Value) - .AndIf(Filter.Priority.HasValue, x => x.Priority == Filter.Priority.Value) - .AndIf(Filter.Source.HasValue, x => x.Source == Filter.Source.Value) - .AndIf(Filter.IsAbandoned.HasValue, x => x.IsAbandoned == Filter.IsAbandoned.Value) + .AndIf(Filter.Status.HasValue, x => x.Status == Filter.Status) + .AndIf(Filter.Priority.HasValue, x => x.Priority == Filter.Priority) + .AndIf(Filter.Source.HasValue, x => x.Source == Filter.Source) + .AndIf(Filter.IsAbandoned.HasValue, x => x.IsAbandoned == Filter.IsAbandoned) .AndIf(Filter.BeginLastRunTime.HasValue, x => x.LastRunTime >= Filter.BeginLastRunTime) .AndIf(Filter.EndLastRunTime.HasValue, x => x.LastRunTime <= Filter.EndLastRunTime) .AndIf(Filter.BeginTime.HasValue, x => x.BeginTime >= Filter.BeginTime) diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobLog.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobLog.cs index 7f0dcca03..068102353 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobLog.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobLog.cs @@ -8,13 +8,13 @@ namespace LINGYUN.Abp.TaskManagement; public class BackgroundJobLog : Entity, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - public virtual string JobId { get; set; } - public virtual string JobName { get; protected set; } - public virtual string JobGroup { get; protected set; } - public virtual string JobType { get; protected set; } - public virtual string Message { get; protected set; } + public virtual string? JobId { get; set; } + public virtual string? JobName { get; protected set; } + public virtual string? JobGroup { get; protected set; } + public virtual string? JobType { get; protected set; } + public virtual string? Message { get; protected set; } public virtual DateTime RunTime { get; protected set; } - public virtual string Exception { get; protected set; } + public virtual string? Exception { get; protected set; } protected BackgroundJobLog() { } public BackgroundJobLog( string type, @@ -30,9 +30,9 @@ public class BackgroundJobLog : Entity, IMultiTenant TenantId = tenantId; } - public BackgroundJobLog SetMessage(string message, Exception ex) + public BackgroundJobLog SetMessage(string? message, Exception? ex) { - Message = message.Length > BackgroundJobLogConsts.MaxMessageLength + Message = message?.Length > BackgroundJobLogConsts.MaxMessageLength ? message.Substring(0, BackgroundJobLogConsts.MaxMessageLength - 1) : message; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobManager.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobManager.cs index 253fd1291..1c33c6cef 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobManager.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobManager.cs @@ -39,7 +39,7 @@ public class BackgroundJobManager : DomainService if (!jobInfo.IsEnabled || resetJob) { - UnitOfWorkManager.Current.OnCompleted(async () => + UnitOfWorkManager.Current!.OnCompleted(async () => { await EventBus.PublishAsync( new JobStopEventData @@ -53,7 +53,7 @@ public class BackgroundJobManager : DomainService if (resetJob && jobInfo.JobType == JobType.Period) { - UnitOfWorkManager.Current.OnCompleted(async () => + UnitOfWorkManager.Current!.OnCompleted(async () => { await EventBus.PublishAsync( new JobStartEventData @@ -72,7 +72,7 @@ public class BackgroundJobManager : DomainService { await BackgroundJobInfoRepository.DeleteAsync(jobInfo); - UnitOfWorkManager.Current.OnCompleted(async () => + UnitOfWorkManager.Current!.OnCompleted(async () => { await EventBus.PublishAsync( new JobDeleteEventData @@ -88,7 +88,7 @@ public class BackgroundJobManager : DomainService { await BackgroundJobInfoRepository.DeleteManyAsync(jobInfos); - UnitOfWorkManager.Current.OnCompleted(async () => + UnitOfWorkManager.Current!.OnCompleted(async () => { await EventBus.PublishAsync( new JobDeleteEventData @@ -157,7 +157,7 @@ public class BackgroundJobManager : DomainService await BackgroundJobInfoRepository.UpdateAsync(jobInfo); - UnitOfWorkManager.Current.OnCompleted(async () => + UnitOfWorkManager.Current!.OnCompleted(async () => { await EventBus.PublishAsync( new JobPauseEventData @@ -179,7 +179,7 @@ public class BackgroundJobManager : DomainService await BackgroundJobInfoRepository.UpdateManyAsync(jobInfos); - UnitOfWorkManager.Current.OnCompleted(async () => + UnitOfWorkManager.Current!.OnCompleted(async () => { await EventBus.PublishAsync( new JobPauseEventData @@ -199,7 +199,7 @@ public class BackgroundJobManager : DomainService await BackgroundJobInfoRepository.UpdateAsync(jobInfo); - UnitOfWorkManager.Current.OnCompleted(async () => + UnitOfWorkManager.Current!.OnCompleted(async () => { await EventBus.PublishAsync( new JobResumeEventData @@ -222,7 +222,7 @@ public class BackgroundJobManager : DomainService await BackgroundJobInfoRepository.UpdateManyAsync(jobInfos); - UnitOfWorkManager.Current.OnCompleted(async () => + UnitOfWorkManager.Current!.OnCompleted(async () => { await EventBus.PublishAsync( new JobResumeEventData @@ -241,7 +241,7 @@ public class BackgroundJobManager : DomainService await BackgroundJobInfoRepository.UpdateAsync(jobInfo); - UnitOfWorkManager.Current.OnCompleted(async () => + UnitOfWorkManager.Current!.OnCompleted(async () => { await EventBus.PublishAsync( new JobStopEventData @@ -263,7 +263,7 @@ public class BackgroundJobManager : DomainService await BackgroundJobInfoRepository.UpdateManyAsync(jobInfos); - UnitOfWorkManager.Current.OnCompleted(async () => + UnitOfWorkManager.Current!.OnCompleted(async () => { await EventBus.PublishAsync( new JobStopEventData diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobStore.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobStore.cs index 2e2eb9244..e4903aa35 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobStore.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/BackgroundJobStore.cs @@ -41,7 +41,7 @@ public class BackgroundJobStore : IJobStore, ITransientDependency return ObjectMapper.Map, List>(jobInfos); } - public async virtual Task> GetRuningListAsync(int maxResultCount, string nodeName = null, CancellationToken cancellationToken = default) + public async virtual Task> GetRuningListAsync(int maxResultCount, string? nodeName = null, CancellationToken cancellationToken = default) { var specification = new ExpressionSpecification( x => x.NodeName == nodeName && x.Status == JobStatus.Running); @@ -61,7 +61,7 @@ public class BackgroundJobStore : IJobStore, ITransientDependency return ObjectMapper.Map, List>(jobInfos); } - public async virtual Task FindAsync( + public async virtual Task FindAsync( string jobId, CancellationToken cancellationToken = default) { @@ -95,7 +95,7 @@ public class BackgroundJobStore : IJobStore, ITransientDependency jobInfo.Name, jobInfo.Group, jobInfo.Type, - jobInfo.Args, + jobInfo.Args!, jobInfo.BeginTime, jobInfo.EndTime, jobInfo.Priority, @@ -125,7 +125,7 @@ public class BackgroundJobStore : IJobStore, ITransientDependency backgroundJobInfo.SetPersistentJob(jobInfo.Interval); break; case JobType.Period: - backgroundJobInfo.SetPeriodJob(jobInfo.Cron); + backgroundJobInfo.SetPeriodJob(jobInfo.Cron!); break; } @@ -173,7 +173,7 @@ public class BackgroundJobStore : IJobStore, ITransientDependency public async virtual Task> CleanupAsync( int maxResultCount, TimeSpan jobExpiratime, - string nodeName = null, + string? nodeName = null, CancellationToken cancellationToken = default) { using var unitOfWork = UnitOfWorkManager.Begin(); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/IBackgroundJobInfoRepository.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/IBackgroundJobInfoRepository.cs index 0aa573e86..9d79c28c1 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/IBackgroundJobInfoRepository.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/IBackgroundJobInfoRepository.cs @@ -21,7 +21,7 @@ public interface IBackgroundJobInfoRepository : IRepository /// /// - Task FindJobAsync( + Task FindJobAsync( string id, bool includeDetails = true, CancellationToken cancellationToken = default); @@ -36,7 +36,7 @@ public interface IBackgroundJobInfoRepository : IRepository> GetExpiredJobsAsync( int maxResultCount, TimeSpan jobExpiratime, - string nodeName = null, + string? nodeName = null, CancellationToken cancellationToken = default); /// /// 获取所有周期性任务 @@ -74,7 +74,7 @@ public interface IBackgroundJobInfoRepository : IRepository Task> GetListAsync( ISpecification specification, - string sorting = nameof(BackgroundJobInfo.Name), + string? sorting = $"{nameof(BackgroundJobInfo.CreationTime)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/IBackgroundJobLogRepository.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/IBackgroundJobLogRepository.cs index 9a517f173..b029f2aee 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/IBackgroundJobLogRepository.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/IBackgroundJobLogRepository.cs @@ -28,7 +28,7 @@ public interface IBackgroundJobLogRepository : IRepository Task> GetListAsync( ISpecification specification, - string sorting = $"{nameof(BackgroundJobLog.RunTime)} DESC", + string? sorting = $"{nameof(BackgroundJobLog.RunTime)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/JobActionStore.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/JobActionStore.cs index 31eba33f4..b61d775ba 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/JobActionStore.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/JobActionStore.cs @@ -25,7 +25,7 @@ public class JobActionStore : IJobActionStore, ITransientDependency return jobActions.Select(action => new JobAction { Name = action.Name, - Paramters = action.Paramters + Paramters = action.Paramters! }).ToList(); } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/TaskManagementDbProperties.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/TaskManagementDbProperties.cs index a396d4036..a4e360358 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/TaskManagementDbProperties.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/TaskManagementDbProperties.cs @@ -4,7 +4,7 @@ public static class TaskManagementDbProperties { public static string DbTablePrefix { get; set; } = "TK_"; - public static string DbSchema { get; set; } = null; + public static string? DbSchema { get; set; } = null; public const string ConnectionStringName = "TaskManagement"; diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/TaskManagementDomainMappers.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/TaskManagementDomainMappers.cs index f073f5964..c047883c2 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/TaskManagementDomainMappers.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN/Abp/TaskManagement/TaskManagementDomainMappers.cs @@ -17,7 +17,7 @@ public partial class BackgroundJobInfoToJobInfoMapper : MapperBase x.JobId.Equals(jobId)) - .WhereIf(isEnabled.HasValue, x => x.IsEnabled == isEnabled.Value) + .WhereIf(isEnabled.HasValue, x => x.IsEnabled == isEnabled) .ToListAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/EfCoreBackgroundJobInfoRepository.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/EfCoreBackgroundJobInfoRepository.cs index 0ca182810..54f33774d 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/EfCoreBackgroundJobInfoRepository.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/EfCoreBackgroundJobInfoRepository.cs @@ -37,7 +37,7 @@ public class EfCoreBackgroundJobInfoRepository : GetCancellationToken(cancellationToken)); } - public async virtual Task FindJobAsync( + public async virtual Task FindJobAsync( string id, bool includeDetails = true, CancellationToken cancellationToken = default) @@ -51,7 +51,7 @@ public class EfCoreBackgroundJobInfoRepository : public async virtual Task> GetExpiredJobsAsync( int maxResultCount, TimeSpan jobExpiratime, - string nodeName = null, + string? nodeName = null, CancellationToken cancellationToken = default) { var expiratime = Clock.Now.Subtract(jobExpiratime); @@ -80,7 +80,12 @@ public class EfCoreBackgroundJobInfoRepository : .CountAsync(GetCancellationToken(cancellationToken)); } - public async virtual Task> GetListAsync(ISpecification specification, string sorting = "Name", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) + public async virtual Task> GetListAsync( + ISpecification specification, + string? sorting = $"{nameof(BackgroundJobInfo.CreationTime)} DESC", + int maxResultCount = 10, + int skipCount = 0, + CancellationToken cancellationToken = default) { if (sorting.IsNullOrWhiteSpace()) { diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/EfCoreBackgroundJobLogRepository.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/EfCoreBackgroundJobLogRepository.cs index 530c22930..4022a3cae 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/EfCoreBackgroundJobLogRepository.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/EfCoreBackgroundJobLogRepository.cs @@ -32,7 +32,7 @@ public class EfCoreBackgroundJobLogRepository : public async virtual Task> GetListAsync( ISpecification specification, - string sorting = $"{nameof(BackgroundJobLog.RunTime)} DESC", + string? sorting = $"{nameof(BackgroundJobLog.RunTime)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/TaskManagementDbContextModelCreatingExtensions.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/TaskManagementDbContextModelCreatingExtensions.cs index edf8cbf72..6a4830885 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/TaskManagementDbContextModelCreatingExtensions.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/TaskManagementDbContextModelCreatingExtensions.cs @@ -14,7 +14,7 @@ public static class TaskManagementDbContextModelCreatingExtensions { public static void ConfigureTaskManagement( this ModelBuilder builder, - Action optionsAction = null) + Action? optionsAction = null) { Check.NotNull(builder, nameof(builder)); diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/TaskManagementModelBuilderConfigurationOptions.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/TaskManagementModelBuilderConfigurationOptions.cs index 03b205c7c..050421c8c 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/TaskManagementModelBuilderConfigurationOptions.cs +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/TaskManagementModelBuilderConfigurationOptions.cs @@ -7,7 +7,7 @@ public class TaskManagementModelBuilderConfigurationOptions : AbpModelBuilderCon { public TaskManagementModelBuilderConfigurationOptions( [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) + [CanBeNull] string? schema = null) : base( tablePrefix, schema) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentDto.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentDto.cs index 163fcfe98..0f9e5cdf3 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentDto.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentDto.cs @@ -2,7 +2,7 @@ public class TextTemplateContentDto { - public string Name { get; set; } - public string Content { get; set; } - public string Culture { get; set; } + public string Name { get; set; } = default!; + public string? Content { get; set; } + public string? Culture { get; set; } } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentGetInput.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentGetInput.cs index 4c13b5595..f7c7583d8 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentGetInput.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentGetInput.cs @@ -7,8 +7,8 @@ public class TextTemplateContentGetInput { [Required] [DynamicStringLength(typeof(TextTemplateConsts), nameof(TextTemplateConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; [DynamicStringLength(typeof(TextTemplateConsts), nameof(TextTemplateConsts.MaxCultureLength))] - public string Culture { get; set; } + public string? Culture { get; set; } } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentUpdateDto.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentUpdateDto.cs index e9e086db9..ec411fecd 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentUpdateDto.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateContentUpdateDto.cs @@ -6,9 +6,9 @@ namespace LINGYUN.Abp.TextTemplating; public class TextTemplateContentUpdateDto { [DynamicStringLength(typeof(TextTemplateConsts), nameof(TextTemplateConsts.MaxCultureLength))] - public string Culture { get; set; } + public string? Culture { get; set; } [Required] [DynamicStringLength(typeof(TextTemplateConsts), nameof(TextTemplateConsts.MaxContentLength))] - public string Content { get; set; } + public string Content { get; set; } = default!; } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionCreateDto.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionCreateDto.cs index a1f4d90fa..eddc45402 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionCreateDto.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionCreateDto.cs @@ -7,5 +7,5 @@ public class TextTemplateDefinitionCreateDto : TextTemplateDefinitionCreateOrUpd { [Required] [DynamicStringLength(typeof(TextTemplateDefinitionConsts), nameof(TextTemplateDefinitionConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionCreateOrUpdateDto.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionCreateOrUpdateDto.cs index bc230e7c7..409714470 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionCreateOrUpdateDto.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionCreateOrUpdateDto.cs @@ -7,21 +7,21 @@ public abstract class TextTemplateDefinitionCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(TextTemplateDefinitionConsts), nameof(TextTemplateDefinitionConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(TextTemplateDefinitionConsts), nameof(TextTemplateDefinitionConsts.MaxDefaultCultureNameLength))] - public string DefaultCultureName { get; set; } + public string? DefaultCultureName { get; set; } [DynamicStringLength(typeof(TextTemplateDefinitionConsts), nameof(TextTemplateDefinitionConsts.MaxLocalizationResourceNameLength))] - public string LocalizationResourceName { get; set; } + public string? LocalizationResourceName { get; set; } public bool IsInlineLocalized { get; set; } public bool IsLayout { get; set; } [DynamicStringLength(typeof(TextTemplateDefinitionConsts), nameof(TextTemplateDefinitionConsts.MaxLayoutLength))] - public string Layout { get; set; } + public string? Layout { get; set; } [DynamicStringLength(typeof(TextTemplateDefinitionConsts), nameof(TextTemplateDefinitionConsts.MaxRenderEngineLength))] - public string RenderEngine { get; set; } + public string? RenderEngine { get; set; } } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionDto.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionDto.cs index eed0675b8..d90877186 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionDto.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionDto.cs @@ -5,14 +5,14 @@ namespace LINGYUN.Abp.TextTemplating; public class TextTemplateDefinitionDto : ExtensibleObject, IHasConcurrencyStamp { - public string Name { get; set; } - public string DisplayName { get; set; } - public string DefaultCultureName { get; set; } - public string LocalizationResourceName { get; set; } - public string RenderEngine { get; set; } + public string Name { get; set; } = default!; + public string DisplayName { get; set; } = default!; + public string? DefaultCultureName { get; set; } + public string? LocalizationResourceName { get; set; } + public string? RenderEngine { get; set; } public bool IsInlineLocalized { get; set; } public bool IsLayout { get; set; } - public string Layout { get; set; } + public string? Layout { get; set; } public bool IsStatic { get; set; } - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionGetListInput.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionGetListInput.cs index 27af03d22..6d9398cf6 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionGetListInput.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionGetListInput.cs @@ -2,7 +2,7 @@ public class TextTemplateDefinitionGetListInput { - public string Filter { get; set; } + public string? Filter { get; set; } public bool? IsStatic { get; set; } public bool? IsLayout { get; set; } } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionUpdateDto.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionUpdateDto.cs index ea5819589..7a5c969a3 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionUpdateDto.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionUpdateDto.cs @@ -3,5 +3,5 @@ namespace LINGYUN.Abp.TextTemplating; public class TextTemplateDefinitionUpdateDto : TextTemplateDefinitionCreateOrUpdateDto, IHasConcurrencyStamp { - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateRestoreInput.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateRestoreInput.cs index d3225ea57..fd10dbd2a 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateRestoreInput.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN/Abp/TextTemplating/TextTemplateRestoreInput.cs @@ -5,5 +5,5 @@ namespace LINGYUN.Abp.TextTemplating; public class TextTemplateRestoreInput { [DynamicStringLength(typeof(TextTemplateConsts), nameof(TextTemplateConsts.MaxCultureLength))] - public string Culture { get; set; } + public string? Culture { get; set; } } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/SettingDefinitionDto.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/SettingDefinitionDto.cs deleted file mode 100644 index ce18f30d9..000000000 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/SettingDefinitionDto.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace LINGYUN.Abp.TextTemplating; - -internal class SettingDefinitionDto -{ -} \ No newline at end of file diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/TextTemplateContentAppService.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/TextTemplateContentAppService.cs index 1259b8744..26d42c6cc 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/TextTemplateContentAppService.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/TextTemplateContentAppService.cs @@ -30,7 +30,7 @@ public class TextTemplateContentAppService : AbpTextTemplatingAppServiceBase, IT public async virtual Task GetAsync(TextTemplateContentGetInput input) { var templateDefinition = await GetTemplateDefinition(input.Name); - string content = null; + string? content = null; try { @@ -63,11 +63,11 @@ public class TextTemplateContentAppService : AbpTextTemplatingAppServiceBase, IT var templateDefinition = await GetTemplateDefinition(name); var templates = await TextTemplateRepository - .GetListAsync(x => x.Name.Equals(templateDefinition.Name) && x.Culture.Equals(input.Culture)); + .GetListAsync(x => x.Name.Equals(templateDefinition.Name) && x.Culture == input.Culture); await TextTemplateRepository.DeleteManyAsync(templates); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } [Authorize(AbpTextTemplatingPermissions.TextTemplateContent.Update)] @@ -81,7 +81,7 @@ public class TextTemplateContentAppService : AbpTextTemplatingAppServiceBase, IT template = new TextTemplate( GuidGenerator.Create(), templateDefinition.Name, - LocalizableStringSerializer.Serialize(templateDefinition.DisplayName), + LocalizableStringSerializer.Serialize(templateDefinition.DisplayName)!, input.Content, input.Culture); @@ -94,7 +94,7 @@ public class TextTemplateContentAppService : AbpTextTemplatingAppServiceBase, IT await TextTemplateRepository.UpdateAsync(template); } - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return new TextTemplateContentDto { diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionAppService.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionAppService.cs index b941162c1..143e108cc 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionAppService.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionAppService.cs @@ -52,7 +52,7 @@ public class TextTemplateDefinitionAppService : AbpTextTemplatingAppServiceBase, await _store.CreateAsync(templateDefinitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(templateDefinitionRecord); } @@ -68,7 +68,8 @@ public class TextTemplateDefinitionAppService : AbpTextTemplatingAppServiceBase, var templateDefinitionRecord = await _repository.FindByNameAsync(name); if (templateDefinitionRecord == null) { - return null; + throw new BusinessException(AbpTextTemplatingErrorCodes.TextTemplateDefinition.TemplateNotFound) + .WithData("Name", name); } return DefinitionRecordToDto(templateDefinitionRecord); } @@ -83,7 +84,7 @@ public class TextTemplateDefinitionAppService : AbpTextTemplatingAppServiceBase, return new ListResultDto(templateDtoList .WhereIf(input.IsStatic.HasValue, x => x.IsStatic == input.IsStatic) .WhereIf(input.IsLayout.HasValue, x => x.IsLayout == input.IsLayout) - .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.Name.Contains(input.Filter) || x.DisplayName.Contains(input.Filter)) + .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.Name.Contains(input.Filter!) || x.DisplayName.Contains(input.Filter!)) .ToList()); } @@ -121,7 +122,7 @@ public class TextTemplateDefinitionAppService : AbpTextTemplatingAppServiceBase, await _store.UpdateAsync(templateDefinitionRecord); } - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(templateDefinitionRecord); } @@ -188,7 +189,7 @@ public class TextTemplateDefinitionAppService : AbpTextTemplatingAppServiceBase, Layout = definition.Layout, Name = definition.Name, LocalizationResourceName = definition.LocalizationResourceName, - DisplayName = _localizableStringSerializer.Serialize(definition.DisplayName), + DisplayName = _localizableStringSerializer.Serialize(definition.DisplayName)!, }; foreach (var property in definition.Properties) diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionEto.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionEto.cs index 89d1da5d3..74c001eb5 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionEto.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/TextTemplateDefinitionEto.cs @@ -2,15 +2,16 @@ namespace LINGYUN.Abp.TextTemplating; +[Serializable] public class TextTemplateDefinitionEto { public Guid Id { get; set; } - public string Name { get; set; } - public string DisplayName { get; set; } + public string Name { get; set; } = default!; + public string DisplayName { get; set; } = default!; public bool IsLayout { get; set; } - public string Layout { get; set; } + public string? Layout { get; set; } public bool IsInlineLocalized { get; set; } - public string DefaultCultureName { get; set; } - public string RenderEngine { get; set; } + public string? DefaultCultureName { get; set; } + public string? RenderEngine { get; set; } public bool IsStatic { get; set; } } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/TextTemplateEto.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/TextTemplateEto.cs index c14994177..b5071bca0 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/TextTemplateEto.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN/Abp/TextTemplating/TextTemplateEto.cs @@ -1,9 +1,12 @@ -namespace LINGYUN.Abp.TextTemplating; +using System; +namespace LINGYUN.Abp.TextTemplating; + +[Serializable] public class TextTemplateEto { - public string Name { get; set; } - public string DisplayName { get; set; } - public string Content { get; set; } - public string Culture { get; set; } + public string Name { get; set; } = default!; + public string DisplayName { get; set; } = default!; + public string? Content { get; set; } + public string? Culture { get; set; } } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbProperties.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbProperties.cs index c4ecb380c..3703ee2ec 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbProperties.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbProperties.cs @@ -6,7 +6,7 @@ public class AbpTextTemplatingDbProperties { public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix; - public static string DbSchema { get; set; } = AbpCommonDbProperties.DbSchema; + public static string? DbSchema { get; set; } = AbpCommonDbProperties.DbSchema; public const string ConnectionStringName = "AbpTextTemplating"; } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITemplateDefinitionStore.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITemplateDefinitionStore.cs index 29aef4554..1f57b96bf 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITemplateDefinitionStore.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITemplateDefinitionStore.cs @@ -20,5 +20,5 @@ public interface ITemplateDefinitionStore Task> GetAllAsync(CancellationToken cancellationToken = default); [CanBeNull] - Task GetOrNullAsync(string name, CancellationToken cancellationToken = default); + Task GetOrNullAsync(string name, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITemplateDefinitionStoreCache.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITemplateDefinitionStoreCache.cs index 945c181f2..7b4f6af5f 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITemplateDefinitionStoreCache.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITemplateDefinitionStoreCache.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Abp.TextTemplating; public interface ITemplateDefinitionStoreCache { - string CacheStamp { get; set; } + string? CacheStamp { get; set; } SemaphoreSlim SyncSemaphore { get; } @@ -18,7 +18,7 @@ public interface ITemplateDefinitionStoreCache List templateDefinitionRecords, IReadOnlyList templateDefinitions); - TemplateDefinition GetOrNull(string name); + TemplateDefinition? GetOrNull(string name); IReadOnlyList GetAll(); } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITextTemplateDefinitionRepository.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITextTemplateDefinitionRepository.cs index f46bb4108..36c51d894 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITextTemplateDefinitionRepository.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITextTemplateDefinitionRepository.cs @@ -7,17 +7,17 @@ using Volo.Abp.Domain.Repositories; namespace LINGYUN.Abp.TextTemplating; public interface ITextTemplateDefinitionRepository : IBasicRepository { - Task FindByNameAsync( + Task FindByNameAsync( string name, CancellationToken cancellationToken = default); Task GetCountAsync( - string filter = null, + string? filter = null, CancellationToken cancellationToken = default); Task> GetListAsync( - string filter = null, - string sorting = nameof(TextTemplateDefinition.Name), + string? filter = null, + string? sorting = nameof(TextTemplateDefinition.Name), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITextTemplateRepository.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITextTemplateRepository.cs index e9a9e56da..a2ec8f848 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITextTemplateRepository.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/ITextTemplateRepository.cs @@ -7,5 +7,8 @@ namespace LINGYUN.Abp.TextTemplating; public interface ITextTemplateRepository : IRepository { - Task FindByNameAsync(string name, string culture = null, CancellationToken cancellationToken = default); + Task FindByNameAsync( + string name, + string? culture = null, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/InMemoryTemplateDefinitionStoreCache.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/InMemoryTemplateDefinitionStoreCache.cs index d2d4ca43f..ba0cb36dc 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/InMemoryTemplateDefinitionStoreCache.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/InMemoryTemplateDefinitionStoreCache.cs @@ -11,7 +11,7 @@ using Volo.Abp.TextTemplating; namespace LINGYUN.Abp.TextTemplating; public class InMemoryTemplateDefinitionStoreCache : ITemplateDefinitionStoreCache, ISingletonDependency { - public string CacheStamp { get; set; } + public string? CacheStamp { get; set; } public SemaphoreSlim SyncSemaphore { get; } public DateTime? LastCheckTime { get; set; } @@ -51,7 +51,7 @@ public class InMemoryTemplateDefinitionStoreCache : ITemplateDefinitionStoreCach } foreach (var property in templateDefinitionRecord.ExtraProperties) { - templateDefinition.WithProperty(property.Key, property.Value); + templateDefinition.WithProperty(property.Key, property.Value!); } templateDefinition.WithProperty(nameof(TextTemplateDefinition.IsStatic), templateDefinitionRecord.IsStatic); @@ -74,7 +74,7 @@ public class InMemoryTemplateDefinitionStoreCache : ITemplateDefinitionStoreCach return Task.CompletedTask; } - public virtual TemplateDefinition GetOrNull(string name) + public virtual TemplateDefinition? GetOrNull(string name) { return TemplateDefinitions.GetOrDefault(name); } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/StaticTemplateSaver.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/StaticTemplateSaver.cs index fa20a8028..e01064897 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/StaticTemplateSaver.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/StaticTemplateSaver.cs @@ -74,7 +74,7 @@ public class StaticTemplateSaver : IStaticTemplateSaver, ITransientDependency var templateDefinitionRecord = new TextTemplateDefinition( GuidGenerator.Create(), templateDefinition.Name, - LocalizableStringSerializer.Serialize(templateDefinition.DisplayName), + LocalizableStringSerializer.Serialize(templateDefinition.DisplayName)!, templateDefinition.IsLayout, templateDefinition.Layout, templateDefinition.IsInlineLocalized, @@ -118,7 +118,7 @@ public class StaticTemplateSaver : IStaticTemplateSaver, ITransientDependency var textTemplate = new TextTemplate( GuidGenerator.Create(), templateDefinition.Name, - LocalizableStringSerializer.Serialize(templateDefinition.DisplayName), + LocalizableStringSerializer.Serialize(templateDefinition.DisplayName)!, content, culture); saveNewTemplates.Add(textTemplate); diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TemplateDefinitionStore.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TemplateDefinitionStore.cs index b05a65978..34e207b52 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TemplateDefinitionStore.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TemplateDefinitionStore.cs @@ -87,14 +87,14 @@ public class TemplateDefinitionStore : ITemplateDefinitionStore, IDynamicTemplat { if (!TemplatingCachingOptions.IsDynamicTemplateDefinitionStoreEnabled) { - return null; + throw new AbpException($"Undefined Template: {name}!"); } using (await TemplateDefinitionStoreCache.SyncSemaphore.LockAsync()) { await EnsureCacheIsUptoDateAsync(); - return TemplateDefinitionStoreCache.GetOrNull(name); + return TemplateDefinitionStoreCache.GetOrNull(name) ?? throw new AbpException($"Undefined Template: {name}!"); } } public async virtual Task GetAsync(string name) @@ -107,7 +107,7 @@ public class TemplateDefinitionStore : ITemplateDefinitionStore, IDynamicTemplat return await GetAllAsync(GetCancellationToken()); } - public async virtual Task GetOrNullAsync(string name) + public async virtual Task GetOrNullAsync(string name) { return await GetOrNullAsync(name, GetCancellationToken()); } @@ -127,7 +127,7 @@ public class TemplateDefinitionStore : ITemplateDefinitionStore, IDynamicTemplat } } - public async virtual Task GetOrNullAsync(string name, CancellationToken cancellationToken = default) + public async virtual Task GetOrNullAsync(string name, CancellationToken cancellationToken = default) { if (!TemplatingCachingOptions.IsDynamicTemplateDefinitionStoreEnabled) { diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplate.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplate.cs index 4b09ea03f..4e65e3932 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplate.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplate.cs @@ -6,27 +6,27 @@ namespace LINGYUN.Abp.TextTemplating; public class TextTemplate : AuditedEntity { - public virtual string Name { get; private set; } - public virtual string DisplayName { get; private set; } - public virtual string Content { get; private set; } - public virtual string Culture { get; private set; } + public virtual string Name { get; private set; } = default!; + public virtual string DisplayName { get; private set; } = default!; + public virtual string? Content { get; private set; } + public virtual string? Culture { get; private set; } protected TextTemplate() { } public TextTemplate( Guid id, string name, string displayName, - string content, - string culture = null) + string? content, + string? culture = null) : base(id) { Name = Check.NotNullOrWhiteSpace(name, nameof(name), TextTemplateConsts.MaxNameLength); DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), TextTemplateConsts.MaxDisplayNameLength); - Content = Check.NotNullOrWhiteSpace(content, nameof(content), TextTemplateConsts.MaxContentLength); + Content = Check.Length(content, nameof(content), TextTemplateConsts.MaxContentLength); Culture = Check.Length(culture, nameof(culture), TextTemplateConsts.MaxCultureLength); } - public void SetContent(string content) + public void SetContent(string? content) { - Content = Check.NotNullOrWhiteSpace(content, nameof(content), TextTemplateConsts.MaxContentLength); + Content = Check.Length(content, nameof(content), TextTemplateConsts.MaxContentLength); } } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateCacheItemInvalidator.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateCacheItemInvalidator.cs index 2f1fc65aa..a703b8f26 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateCacheItemInvalidator.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateCacheItemInvalidator.cs @@ -42,7 +42,7 @@ public class TextTemplateCacheItemInvalidator : await Cache.RemoveAsync(cacheKey); } - protected virtual string CalculateCacheKey(string name, string culture = null) + protected virtual string CalculateCacheKey(string name, string? culture = null) { return TextTemplateContentCacheItem.CalculateCacheKey(name, culture); } diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentCacheItem.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentCacheItem.cs index 9e2034a66..a372340b8 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentCacheItem.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentCacheItem.cs @@ -9,9 +9,9 @@ public class TextTemplateContentCacheItem { private const string CacheKeyFormat = "pn:template-content,n:{0},c:{1}"; - public string Name { get; set; } - public string Culture { get; set; } - public string Content { get; set; } + public string Name { get; set; } = default!; + public string? Culture { get; set; } + public string? Content { get; set; } public TextTemplateContentCacheItem() { @@ -19,8 +19,8 @@ public class TextTemplateContentCacheItem public TextTemplateContentCacheItem( string name, - string content, - string culture = null) + string? content, + string? culture = null) { Name = name; Content = content; @@ -29,7 +29,7 @@ public class TextTemplateContentCacheItem public static string CalculateCacheKey( string name, - string culture = null) + string? culture = null) { return string.Format( CacheKeyFormat, diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentContributor.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentContributor.cs index 58c56fa83..7389b0b2d 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentContributor.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentContributor.cs @@ -27,12 +27,12 @@ public class TextTemplateContentContributor : ITemplateContentContributor, ITran Logger = NullLogger.Instance; } - public async virtual Task GetOrNullAsync(TemplateContentContributorContext context) + public async virtual Task GetOrNullAsync(TemplateContentContributorContext context) { - return (await GetCacheItemAsync(context)).Content; + return (await GetCacheItemAsync(context))?.Content; } - protected async virtual Task GetCacheItemAsync(TemplateContentContributorContext context) + protected async virtual Task GetCacheItemAsync(TemplateContentContributorContext context) { var culture = context.TemplateDefinition.IsInlineLocalized ? null : context.Culture; var cacheKey = TextTemplateContentCacheItem.CalculateCacheKey(context.TemplateDefinition.Name, culture); @@ -57,7 +57,7 @@ public class TextTemplateContentContributor : ITemplateContentContributor, ITran } cacheItem = new TextTemplateContentCacheItem( - template?.Name, + context.TemplateDefinition.Name, template?.Content, template?.Culture); diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentProvider.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentProvider.cs index 281e1e309..0cef3afa4 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentProvider.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateContentProvider.cs @@ -24,9 +24,9 @@ public class TextTemplateContentProvider : TemplateContentProvider, ITransientDe TemplateDefinitionStore = templateDefinitionStore; } - public async override Task GetContentOrNullAsync( + public async override Task GetContentOrNullAsync( string templateName, - string cultureName = null, + string? cultureName = null, bool tryDefaults = true, bool useCurrentCultureIfCultureNameIsNull = true) { diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateDefinition.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateDefinition.cs index c451b8e63..49f42e055 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateDefinition.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN/Abp/TextTemplating/TextTemplateDefinition.cs @@ -6,14 +6,14 @@ using Volo.Abp.Domain.Entities; namespace LINGYUN.Abp.TextTemplating; public class TextTemplateDefinition : AggregateRoot, IHasExtraProperties { - public virtual string Name { get; protected set; } - public virtual string DisplayName { get; set; } + public virtual string Name { get; protected set; } = default!; + public virtual string DisplayName { get; set; } = default!; public virtual bool IsLayout { get; set; } - public virtual string Layout { get; set; } + public virtual string? Layout { get; set; } public virtual bool IsInlineLocalized { get; set; } - public virtual string DefaultCultureName { get; set; } - public virtual string LocalizationResourceName { get; set; } - public virtual string RenderEngine { get; set; } + public virtual string? DefaultCultureName { get; set; } + public virtual string? LocalizationResourceName { get; set; } + public virtual string? RenderEngine { get; set; } public virtual bool IsStatic { get; set; } protected TextTemplateDefinition() { @@ -25,11 +25,11 @@ public class TextTemplateDefinition : AggregateRoot, IHasExtraProperties string name, string displayName, bool isLayout = false, - string layout = null, + string? layout = null, bool isInlineLocalized = false, - string defaultCultureName = null, - string localizationResourceName = null, - string renderEngine = null) + string? defaultCultureName = null, + string? localizationResourceName = null, + string? renderEngine = null) : base(id) { Name = Check.NotNullOrWhiteSpace(name, nameof(name), TextTemplateDefinitionConsts.MaxNameLength); diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbContextModelCreatingExtensions.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbContextModelCreatingExtensions.cs index 52f4b5062..0aef68fc5 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbContextModelCreatingExtensions.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/AbpTextTemplatingDbContextModelCreatingExtensions.cs @@ -1,75 +1,75 @@ -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Volo.Abp; -using Volo.Abp.EntityFrameworkCore.Modeling; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace LINGYUN.Abp.TextTemplating.EntityFrameworkCore; + +public static class AbpTextTemplatingDbContextModelCreatingExtensions +{ + public static void ConfigureTextTemplating( + this ModelBuilder builder) + { + Check.NotNull(builder, nameof(builder)); + + builder.Entity(b => + { + b.ToTable(AbpTextTemplatingDbProperties.DbTablePrefix + "TextTemplates", AbpTextTemplatingDbProperties.DbSchema); + + b.ConfigureByConvention(); + + b.Property(t => t.Name) + .HasColumnName(nameof(TextTemplate.Name)) + .HasMaxLength(TextTemplateConsts.MaxNameLength) + .IsRequired(); + b.Property(t => t.DisplayName) + .HasColumnName(nameof(TextTemplate.DisplayName)) + .HasMaxLength(TextTemplateConsts.MaxDisplayNameLength) + .IsRequired(); + + b.Property(t => t.Culture) + .HasColumnName(nameof(TextTemplate.Culture)) + .HasMaxLength(TextTemplateConsts.MaxCultureLength); + b.Property(t => t.Content) + .HasColumnName(nameof(TextTemplate.Content)) + .HasMaxLength(TextTemplateConsts.MaxContentLength); -namespace LINGYUN.Abp.TextTemplating.EntityFrameworkCore; - -public static class AbpTextTemplatingDbContextModelCreatingExtensions -{ - public static void ConfigureTextTemplating( - this ModelBuilder builder) - { - Check.NotNull(builder, nameof(builder)); - - builder.Entity(b => - { - b.ToTable(AbpTextTemplatingDbProperties.DbTablePrefix + "TextTemplates", AbpTextTemplatingDbProperties.DbSchema); - - b.ConfigureByConvention(); - - b.Property(t => t.Name) - .HasColumnName(nameof(TextTemplate.Name)) - .HasMaxLength(TextTemplateConsts.MaxNameLength) - .IsRequired(); - b.Property(t => t.DisplayName) - .HasColumnName(nameof(TextTemplate.DisplayName)) - .HasMaxLength(TextTemplateConsts.MaxDisplayNameLength) - .IsRequired(); - - b.Property(t => t.Culture) - .HasColumnName(nameof(TextTemplate.Culture)) - .HasMaxLength(TextTemplateConsts.MaxCultureLength); - b.Property(t => t.Content) - .HasColumnName(nameof(TextTemplate.Content)) - .HasMaxLength(TextTemplateConsts.MaxContentLength); - b.HasIndex(p => p.Name) - .HasDatabaseName("IX_Tenant_Text_Template_Name"); - - b.ApplyObjectExtensionMappings(); - }); - - builder.Entity(b => - { - b.ToTable(AbpTextTemplatingDbProperties.DbTablePrefix + "TextTemplateDefinitions", AbpTextTemplatingDbProperties.DbSchema); - - b.ConfigureByConvention(); - - b.Property(t => t.Name) - .HasColumnName(nameof(TextTemplateDefinition.Name)) - .HasMaxLength(TextTemplateDefinitionConsts.MaxNameLength) - .IsRequired(); - b.Property(t => t.DisplayName) - .HasColumnName(nameof(TextTemplateDefinition.DisplayName)) - .HasMaxLength(TextTemplateDefinitionConsts.MaxDisplayNameLength) - .IsRequired(); - - b.Property(t => t.Layout) - .HasColumnName(nameof(TextTemplateDefinition.Layout)) - .HasMaxLength(TextTemplateDefinitionConsts.MaxLayoutLength); - b.Property(t => t.DefaultCultureName) - .HasColumnName(nameof(TextTemplateDefinition.DefaultCultureName)) + .HasDatabaseName("IX_Tenant_Text_Template_Name"); + + b.ApplyObjectExtensionMappings(); + }); + + builder.Entity(b => + { + b.ToTable(AbpTextTemplatingDbProperties.DbTablePrefix + "TextTemplateDefinitions", AbpTextTemplatingDbProperties.DbSchema); + + b.ConfigureByConvention(); + + b.Property(t => t.Name) + .HasColumnName(nameof(TextTemplateDefinition.Name)) + .HasMaxLength(TextTemplateDefinitionConsts.MaxNameLength) + .IsRequired(); + b.Property(t => t.DisplayName) + .HasColumnName(nameof(TextTemplateDefinition.DisplayName)) + .HasMaxLength(TextTemplateDefinitionConsts.MaxDisplayNameLength) + .IsRequired(); + + b.Property(t => t.Layout) + .HasColumnName(nameof(TextTemplateDefinition.Layout)) + .HasMaxLength(TextTemplateDefinitionConsts.MaxLayoutLength); + b.Property(t => t.DefaultCultureName) + .HasColumnName(nameof(TextTemplateDefinition.DefaultCultureName)) .HasMaxLength(TextTemplateDefinitionConsts.MaxDefaultCultureNameLength); b.Property(t => t.RenderEngine) .HasColumnName(nameof(TextTemplateDefinition.RenderEngine)) - .HasMaxLength(TextTemplateDefinitionConsts.MaxRenderEngineLength); + .HasMaxLength(TextTemplateDefinitionConsts.MaxRenderEngineLength); b.Property(t => t.LocalizationResourceName) .HasColumnName(nameof(TextTemplateDefinition.LocalizationResourceName)) - .HasMaxLength(TextTemplateDefinitionConsts.MaxLocalizationResourceNameLength); - - b.ApplyObjectExtensionMappings(); - }); - - builder.TryConfigureObjectExtensions(); - } -} + .HasMaxLength(TextTemplateDefinitionConsts.MaxLocalizationResourceNameLength); + + b.ApplyObjectExtensionMappings(); + }); + + builder.TryConfigureObjectExtensions(); + } +} diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/EfCoreTextTemplateDefinitionRepository.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/EfCoreTextTemplateDefinitionRepository.cs index 714bcafaa..2cb30174a 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/EfCoreTextTemplateDefinitionRepository.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/EfCoreTextTemplateDefinitionRepository.cs @@ -18,24 +18,24 @@ public class EfCoreTextTemplateDefinitionRepository : EfCoreRepository FindByNameAsync(string name, CancellationToken cancellationToken = default) + public async virtual Task FindByNameAsync(string name, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) .Where(x => x.Name == name) .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } - public async virtual Task GetCountAsync(string filter = null, CancellationToken cancellationToken = default) + public async virtual Task GetCountAsync(string? filter = null, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter) || - x.DefaultCultureName.Contains(filter) || x.Layout.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter!) || + x.DefaultCultureName!.Contains(filter!) || x.Layout!.Contains(filter!)) .CountAsync(GetCancellationToken(cancellationToken)); } public async virtual Task> GetListAsync( - string filter = null, - string sorting = "Name", + string? filter = null, + string? sorting = nameof(TextTemplateDefinition.Name), int skipCount = 0, int maxResultCount = 10, CancellationToken cancellationToken = default) @@ -46,8 +46,8 @@ public class EfCoreTextTemplateDefinitionRepository : EfCoreRepository x.Name.Contains(filter) || - x.DefaultCultureName.Contains(filter) || x.Layout.Contains(filter)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter!) || + x.DefaultCultureName!.Contains(filter!) || x.Layout!.Contains(filter!)) .OrderBy(sorting) .PageBy(skipCount, maxResultCount) .ToListAsync(GetCancellationToken(cancellationToken)); diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/EfCoreTextTemplateRepository.cs b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/EfCoreTextTemplateRepository.cs index f16e669b5..0b888da2a 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/EfCoreTextTemplateRepository.cs +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN/Abp/TextTemplating/EfCoreTextTemplateRepository.cs @@ -1,6 +1,5 @@ using Microsoft.EntityFrameworkCore; using System; -using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -21,10 +20,13 @@ public class EfCoreTextTemplateRepository : { } - public async virtual Task FindByNameAsync(string name, string culture = null, CancellationToken cancellationToken = default) + public async virtual Task FindByNameAsync( + string name, + string? culture = null, + CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) - .Where(x => x.Name.Equals(name) && x.Culture.Equals(culture)) + .Where(x => x.Name.Equals(name) && x.Culture == culture) .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IDynamicWebhookDefinitionStore.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IDynamicWebhookDefinitionStore.cs index 5c34bcc01..b7b162e94 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IDynamicWebhookDefinitionStore.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IDynamicWebhookDefinitionStore.cs @@ -5,11 +5,11 @@ namespace LINGYUN.Abp.Webhooks; public interface IDynamicWebhookDefinitionStore { - Task GetOrNullAsync(string name); + Task GetOrNullAsync(string name); Task> GetWebhooksAsync(); - Task GetGroupOrNullAsync(string name); + Task GetGroupOrNullAsync(string name); Task> GetGroupsAsync(); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IStaticWebhookDefinitionStore.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IStaticWebhookDefinitionStore.cs index 8664ae4b4..748f55068 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IStaticWebhookDefinitionStore.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IStaticWebhookDefinitionStore.cs @@ -5,11 +5,11 @@ namespace LINGYUN.Abp.Webhooks; public interface IStaticWebhookDefinitionStore { - Task GetOrNullAsync(string name); + Task GetOrNullAsync(string name); Task> GetWebhooksAsync(); - Task GetGroupOrNullAsync(string name); + Task GetGroupOrNullAsync(string name); Task> GetGroupsAsync(); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionContext.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionContext.cs index b714ce636..b16c8fad7 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionContext.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionContext.cs @@ -7,9 +7,9 @@ public interface IWebhookDefinitionContext { WebhookGroupDefinition AddGroup( [NotNull] string name, - ILocalizableString displayName = null); + ILocalizableString? displayName = null); - WebhookGroupDefinition GetGroupOrNull(string name); + WebhookGroupDefinition? GetGroupOrNull(string name); void RemoveGroup(string name); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionManager.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionManager.cs index d2a4c5304..f6e683e03 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionManager.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionManager.cs @@ -11,7 +11,7 @@ public interface IWebhookDefinitionManager /// Gets a webhook definition by name. /// Returns null if there is no webhook definition with given name. /// - Task GetOrNullAsync(string name); + Task GetOrNullAsync(string name); /// /// Gets a webhook definition by name. @@ -29,7 +29,7 @@ public interface IWebhookDefinitionManager /// Gets a webhook group definition by name. /// Returns null if there is no webhook group definition with given name. /// - Task GetGroupOrNullAsync(string name); + Task GetGroupOrNullAsync(string name); /// /// Gets a webhook definition by name. diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/NullDynamicWebhookDefinitionStore.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/NullDynamicWebhookDefinitionStore.cs index 40b379df0..04b233845 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/NullDynamicWebhookDefinitionStore.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/NullDynamicWebhookDefinitionStore.cs @@ -9,9 +9,9 @@ namespace LINGYUN.Abp.Webhooks; [Dependency(TryRegister = true)] public class NullDynamicWebhookDefinitionStore : IDynamicWebhookDefinitionStore, ISingletonDependency { - private readonly static Task CachedWebhookResult = Task.FromResult((WebhookDefinition)null); + private readonly static Task CachedWebhookResult = Task.FromResult((WebhookDefinition?)null); - private readonly static Task CachedWebhookGroupResult = Task.FromResult((WebhookGroupDefinition)null); + private readonly static Task CachedWebhookGroupResult = Task.FromResult((WebhookGroupDefinition?)null); private readonly static Task> CachedWebhooksResult = Task.FromResult((IReadOnlyList)Array.Empty().ToImmutableList()); @@ -19,7 +19,7 @@ public class NullDynamicWebhookDefinitionStore : IDynamicWebhookDefinitionStore, private readonly static Task> CachedGroupsResult = Task.FromResult((IReadOnlyList)Array.Empty().ToImmutableList()); - public Task GetOrNullAsync(string name) + public Task GetOrNullAsync(string name) { return CachedWebhookResult; } @@ -34,7 +34,7 @@ public class NullDynamicWebhookDefinitionStore : IDynamicWebhookDefinitionStore, return CachedGroupsResult; } - public Task GetGroupOrNullAsync(string name) + public Task GetGroupOrNullAsync(string name) { return CachedWebhookGroupResult; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/StaticWebhookDefinitionStore.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/StaticWebhookDefinitionStore.cs index d111324af..8ec9e5e76 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/StaticWebhookDefinitionStore.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/StaticWebhookDefinitionStore.cs @@ -73,14 +73,14 @@ public class StaticWebhookDefinitionStore : IStaticWebhookDefinitionStore, ISing foreach (var provider in providers) { - provider.Define(new WebhookDefinitionContext(definitions)); + provider?.Define(new WebhookDefinitionContext(definitions)); } } return definitions; } - public virtual Task GetOrNullAsync(string name) + public virtual Task GetOrNullAsync(string name) { return Task.FromResult(WebhookDefinitions.GetOrDefault(name)); } @@ -99,7 +99,7 @@ public class StaticWebhookDefinitionStore : IStaticWebhookDefinitionStore, ISing ); } - public virtual Task GetGroupOrNullAsync(string name) + public virtual Task GetGroupOrNullAsync(string name) { return Task.FromResult(WebhookGroupDefinitions.GetOrDefault(name)); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinition.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinition.cs index 059cc57b4..61dfd7409 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinition.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinition.cs @@ -14,30 +14,30 @@ public class WebhookDefinition // /// Group name of the webhook. /// - public string GroupName { get; internal set; } + public string GroupName { get; internal set; } = default!; /// /// Display name of the webhook. /// Optional. /// - public ILocalizableString DisplayName { get; set; } + public ILocalizableString? DisplayName { get; set; } /// /// Description for the webhook. /// Optional. /// - public ILocalizableString Description { get; set; } + public ILocalizableString? Description { get; set; } public List RequiredFeatures { get; set; } - public Dictionary Properties { get; } + public Dictionary Properties { get; } - public object this[string name] { + public object? this[string name] { get => Properties.GetOrDefault(name); set => Properties[name] = value; } - public WebhookDefinition(string name, ILocalizableString displayName = null, ILocalizableString description = null) + public WebhookDefinition(string name, ILocalizableString? displayName = null, ILocalizableString? description = null) { if (name.IsNullOrWhiteSpace()) { @@ -49,7 +49,7 @@ public class WebhookDefinition Description = description; RequiredFeatures = new List(); - Properties = new Dictionary(); + Properties = new Dictionary(); } public WebhookDefinition WithFeature(params string[] features) @@ -62,7 +62,7 @@ public class WebhookDefinition return this; } - public WebhookDefinition WithProperty(string key, object value) + public WebhookDefinition WithProperty(string key, object? value) { Properties[key] = value; return this; diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionContext.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionContext.cs index 6302158d8..5a8fdc03e 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionContext.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionContext.cs @@ -16,7 +16,7 @@ public class WebhookDefinitionContext : IWebhookDefinitionContext public WebhookGroupDefinition AddGroup( [NotNull] string name, - ILocalizableString displayName = null) + ILocalizableString? displayName = null) { Check.NotNull(name, nameof(name)); @@ -28,7 +28,7 @@ public class WebhookDefinitionContext : IWebhookDefinitionContext return Groups[name] = new WebhookGroupDefinition(name, displayName); } - public WebhookGroupDefinition GetGroupOrNull([NotNull] string name) + public WebhookGroupDefinition? GetGroupOrNull([NotNull] string name) { Check.NotNull(name, nameof(name)); diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionManager.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionManager.cs index 79468bef8..2b726b4c0 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionManager.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionManager.cs @@ -31,7 +31,7 @@ internal class WebhookDefinitionManager : IWebhookDefinitionManager, ISingletonD _webhooksOptions = webhooksOptions.Value; } - public async virtual Task GetOrNullAsync(string name) + public async virtual Task GetOrNullAsync(string name) { Check.NotNull(name, nameof(name)); @@ -65,7 +65,7 @@ internal class WebhookDefinitionManager : IWebhookDefinitionManager, ISingletonD }; } - public async virtual Task GetGroupOrNullAsync(string name) + public async virtual Task GetGroupOrNullAsync(string name) { Check.NotNull(name, nameof(name)); @@ -113,7 +113,7 @@ internal class WebhookDefinitionManager : IWebhookDefinitionManager, ISingletonD return false; } - if (webhookDefinition.RequiredFeatures?.Any() == false) + if (webhookDefinition.RequiredFeatures.Any() == false) { return true; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookEvent.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookEvent.cs index e8aaddc45..4fad734ce 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookEvent.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookEvent.cs @@ -9,12 +9,12 @@ public class WebhookEvent /// /// Webhook unique name /// - public string WebhookName { get; set; } + public string WebhookName { get; set; } = default!; /// /// Webhook data as JSON string. /// - public string Data { get; set; } + public string? Data { get; set; } public DateTime CreationTime { get; set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookGroupDefinition.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookGroupDefinition.cs index b8481cb26..2ce2dc98d 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookGroupDefinition.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookGroupDefinition.cs @@ -10,11 +10,11 @@ namespace LINGYUN.Abp.Webhooks; public class WebhookGroupDefinition { [NotNull] - public string Name { get; set; } - public Dictionary Properties { get; } + public string Name { get; set; } = default!; + public Dictionary Properties { get; } - private ILocalizableString _displayName; - public ILocalizableString DisplayName + private ILocalizableString? _displayName; + public ILocalizableString? DisplayName { get { return _displayName; @@ -26,26 +26,26 @@ public class WebhookGroupDefinition public IReadOnlyList Webhooks => _webhooks.ToImmutableList(); private readonly List _webhooks; - public object this[string name] { + public object? this[string name] { get => Properties.GetOrDefault(name); set => Properties[name] = value; } protected internal WebhookGroupDefinition( string name, - ILocalizableString displayName = null) + ILocalizableString? displayName = null) { Name = name; DisplayName = displayName ?? new FixedLocalizableString(Name); - Properties = new Dictionary(); + Properties = new Dictionary(); _webhooks = new List(); } public virtual WebhookDefinition AddWebhook( string name, - ILocalizableString displayName = null, - ILocalizableString description = null) + ILocalizableString? displayName = null, + ILocalizableString? description = null) { if (Webhooks.Any(hook => hook.Name.Equals(name))) { @@ -84,7 +84,7 @@ public class WebhookGroupDefinition [CanBeNull] - public WebhookDefinition GetWebhookOrNull([NotNull] string name) + public WebhookDefinition? GetWebhookOrNull([NotNull] string name) { Check.NotNull(name, nameof(name)); @@ -99,6 +99,12 @@ public class WebhookGroupDefinition return null; } + public WebhookGroupDefinition WithProperty(string key, object? value) + { + Properties[key] = value; + return this; + } + public override string ToString() { return $"[{nameof(WebhookGroupDefinition)} {Name}]"; diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookPayload.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookPayload.cs index ba073130b..7638f0172 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookPayload.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookPayload.cs @@ -6,11 +6,11 @@ public class WebhookPayload { public string Id { get; set; } - public string WebhookEvent { get; set; } + public string WebhookEvent { get; set; } = default!; public int Attempt { get; set; } - public dynamic Data { get; set; } + public dynamic Data { get; set; } = default!; public DateTime CreationTimeUtc { get; set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN/Abp/Webhooks/EventBus/DistributedEventBusWebhookPublisher.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN/Abp/Webhooks/EventBus/DistributedEventBusWebhookPublisher.cs index 25ed2e890..52dd45799 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN/Abp/Webhooks/EventBus/DistributedEventBusWebhookPublisher.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN/Abp/Webhooks/EventBus/DistributedEventBusWebhookPublisher.cs @@ -20,7 +20,7 @@ public class DistributedEventBusWebhookPublisher : IWebhookPublisher, ITransient string webhookName, object data, bool sendExactSameData = false, - WebhookHeader headers = null) + WebhookHeader? headers = null) { var eventData = new WebhooksEventData( webhookName, @@ -36,7 +36,7 @@ public class DistributedEventBusWebhookPublisher : IWebhookPublisher, ITransient object data, Guid? tenantId, bool sendExactSameData = false, - WebhookHeader headers = null) + WebhookHeader? headers = null) { var eventData = new WebhooksEventData( webhookName, @@ -53,7 +53,7 @@ public class DistributedEventBusWebhookPublisher : IWebhookPublisher, ITransient string webhookName, object data, bool sendExactSameData = false, - WebhookHeader headers = null) + WebhookHeader? headers = null) { var eventData = new WebhooksEventData( webhookName, diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN/Abp/Webhooks/EventBus/WebhooksEventData.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN/Abp/Webhooks/EventBus/WebhooksEventData.cs index b711504fe..d72aaccab 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN/Abp/Webhooks/EventBus/WebhooksEventData.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN/Abp/Webhooks/EventBus/WebhooksEventData.cs @@ -9,9 +9,9 @@ public class WebhooksEventData { public Guid?[] TenantIds { get; set; } - public string WebhookName { get; set; } + public string WebhookName { get; set; } = default!; - public string Data { get; set; } + public string? Data { get; set; } public bool SendExactSameData { get; set; } @@ -25,10 +25,10 @@ public class WebhooksEventData public WebhooksEventData( string webhookName, - string data, + string? data, bool sendExactSameData = false, - WebhookHeader headers = null, - Guid?[] tenantIds = null) + WebhookHeader? headers = null, + Guid?[]? tenantIds = null) { WebhookName = webhookName; Data = data; diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityRoleNameChangedWto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityRoleNameChangedWto.cs index c91615749..b4e6108de 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityRoleNameChangedWto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityRoleNameChangedWto.cs @@ -7,7 +7,7 @@ public class IdentityRoleNameChangedWto { public Guid Id { get; set; } - public string Name { get; set; } + public string Name { get; set; } = default!; - public string OldName { get; set; } + public string OldName { get; set; } = default!; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityRoleWto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityRoleWto.cs index 1271a5877..0e7c8efd4 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityRoleWto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityRoleWto.cs @@ -7,5 +7,5 @@ public class IdentityRoleWto { public Guid Id { get; set; } - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityUserWto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityUserWto.cs index 29da00874..14889b53c 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityUserWto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/IdentityUserWto.cs @@ -7,17 +7,17 @@ public class IdentityUserWto { public Guid Id { get; set; } - public string UserName { get; set; } + public string UserName { get; set; } = default!; - public string Name { get; set; } + public string? Name { get; set; } - public string Surname { get; set; } + public string? Surname { get; set; } - public string Email { get; set; } + public string Email { get; set; } = default!; public bool EmailConfirmed { get; set; } - public string PhoneNumber { get; set; } + public string? PhoneNumber { get; set; } public bool PhoneNumberConfirmed { get; set; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/OrganizationUnitWto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/OrganizationUnitWto.cs index 3dd758890..034b668e5 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/OrganizationUnitWto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN/Abp/Webhooks/Identity/OrganizationUnitWto.cs @@ -7,7 +7,7 @@ public class OrganizationUnitWto { public Guid Id { get; set; } - public string Code { get; set; } + public string? Code { get; set; } - public string DisplayName { get; set; } + public string? DisplayName { get; set; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN/Abp/Webhooks/Saas/EditionWto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN/Abp/Webhooks/Saas/EditionWto.cs index 8a3a1208b..c354ec22e 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN/Abp/Webhooks/Saas/EditionWto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN/Abp/Webhooks/Saas/EditionWto.cs @@ -7,5 +7,5 @@ public class EditionWto { public Guid Id { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN/Abp/Webhooks/Saas/TenantWto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN/Abp/Webhooks/Saas/TenantWto.cs index ba2d4ef0d..38a17965f 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN/Abp/Webhooks/Saas/TenantWto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN/Abp/Webhooks/Saas/TenantWto.cs @@ -7,6 +7,6 @@ public class TenantWto { public Guid Id { get; set; } - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookPublisher.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookPublisher.cs index bf44162ae..210b1bf5f 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookPublisher.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookPublisher.cs @@ -36,7 +36,7 @@ namespace LINGYUN.Abp.Webhooks string webhookName, object data, bool sendExactSameData = false, - WebhookHeader headers = null) + WebhookHeader? headers = null) { var subscriptions = await _webhookSubscriptionManager.GetAllSubscriptionsIfFeaturesGrantedAsync(_currentTenant.Id, webhookName); await PublishAsync(webhookName, data, subscriptions, sendExactSameData, headers); @@ -47,7 +47,7 @@ namespace LINGYUN.Abp.Webhooks object data, Guid? tenantId, bool sendExactSameData = false, - WebhookHeader headers = null) + WebhookHeader? headers = null) { var subscriptions = await _webhookSubscriptionManager.GetAllSubscriptionsIfFeaturesGrantedAsync(tenantId, webhookName); await PublishAsync(webhookName, data, subscriptions, sendExactSameData, headers); @@ -58,7 +58,7 @@ namespace LINGYUN.Abp.Webhooks string webhookName, object data, bool sendExactSameData = false, - WebhookHeader headers = null) + WebhookHeader? headers = null) { var subscriptions = await _webhookSubscriptionManager.GetAllSubscriptionsOfTenantsIfFeaturesGrantedAsync(tenantIds, webhookName); await PublishAsync(webhookName, data, subscriptions, sendExactSameData, headers); @@ -69,7 +69,7 @@ namespace LINGYUN.Abp.Webhooks object data, List webhookSubscriptions, bool sendExactSameData = false, - WebhookHeader headers = null) + WebhookHeader? headers = null) { if (webhookSubscriptions.IsNullOrEmpty()) { diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookSender.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookSender.cs index c50c97589..38bd9bd3d 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookSender.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookSender.cs @@ -60,7 +60,7 @@ namespace LINGYUN.Abp.Webhooks HttpStatusCode? statusCode = null; var content = FailedRequestDefaultContent; var reqHeaders = GetHeaders(request.Headers); - IDictionary resHeaders = null; + IDictionary? resHeaders = null; try { @@ -139,7 +139,7 @@ namespace LINGYUN.Abp.Webhooks } } - if (!request.Content.Headers.Contains(header.Key)) + if (!request.Content!.Headers.Contains(header.Key)) { if (request.Content.Headers.TryAddWithoutValidation(header.Key, header.Value)) { @@ -165,7 +165,7 @@ namespace LINGYUN.Abp.Webhooks } } - if (request.Content.Headers.Contains(header.Key) && request.Content.Headers.Remove(header.Key)) + if (request.Content!.Headers.Contains(header.Key) && request.Content.Headers.Remove(header.Key)) { if (request.Content.Headers.TryAddWithoutValidation(header.Key, header.Value)) { diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/IWebhookManager.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/IWebhookManager.cs index aa5fa026c..696247b4b 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/IWebhookManager.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/IWebhookManager.cs @@ -10,9 +10,9 @@ namespace LINGYUN.Abp.Webhooks { Task GetWebhookPayloadAsync(WebhookSenderArgs webhookSenderArgs); - void SignWebhookRequest(HttpRequestMessage request, string serializedBody, string secret); + void SignWebhookRequest(HttpRequestMessage request, string? serializedBody, string? secret); - Task GetSerializedBodyAsync(WebhookSenderArgs webhookSenderArgs); + Task GetSerializedBodyAsync(WebhookSenderArgs webhookSenderArgs); Task InsertAndGetIdWebhookSendAttemptAsync(WebhookSenderArgs webhookSenderArgs); @@ -21,7 +21,7 @@ namespace LINGYUN.Abp.Webhooks Guid? tenantId, HttpStatusCode? statusCode, string content, - IDictionary requestHeaders = null, - IDictionary responseHeaders = null); + IDictionary? requestHeaders = null, + IDictionary? responseHeaders = null); } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/IWebhookPublisher.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/IWebhookPublisher.cs index 09962844e..e1340a94f 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/IWebhookPublisher.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/IWebhookPublisher.cs @@ -17,7 +17,7 @@ namespace LINGYUN.Abp.Webhooks /// /// /// Headers to send. Publisher uses subscription defined webhook by default. You can add additional headers from here. If subscription already has given header, publisher uses the one you give here. - Task PublishAsync(string webhookName, object data, bool sendExactSameData = false, WebhookHeader headers = null); + Task PublishAsync(string webhookName, object data, bool sendExactSameData = false, WebhookHeader? headers = null); /// /// Sends webhooks to given tenant's subscriptions @@ -34,7 +34,7 @@ namespace LINGYUN.Abp.Webhooks /// /// /// Headers to send. Publisher uses subscription defined webhook by default. You can add additional headers from here. If subscription already has given header, publisher uses the one you give here. - Task PublishAsync(string webhookName, object data, Guid? tenantId, bool sendExactSameData = false, WebhookHeader headers = null); + Task PublishAsync(string webhookName, object data, Guid? tenantId, bool sendExactSameData = false, WebhookHeader? headers = null); /// /// Sends webhooks to given tenant's subscriptions @@ -51,6 +51,6 @@ namespace LINGYUN.Abp.Webhooks /// /// /// Headers to send. Publisher uses subscription defined webhook by default. You can add additional headers from here. If subscription already has given header, publisher uses the one you give here. - Task PublishAsync(Guid?[] tenantIds, string webhookName, object data, bool sendExactSameData = false, WebhookHeader headers = null); + Task PublishAsync(Guid?[] tenantIds, string webhookName, object data, bool sendExactSameData = false, WebhookHeader? headers = null); } } \ No newline at end of file diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookEventStore.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookEventStore.cs index 069726e67..844e7f4d0 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookEventStore.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookEventStore.cs @@ -18,7 +18,7 @@ namespace LINGYUN.Abp.Webhooks public Task GetAsync(Guid? tenantId, Guid id) { - return Task.FromResult(default); + return Task.FromResult(default!); } } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookSendAttemptStore.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookSendAttemptStore.cs index 7254b1ae6..6e86d8ccb 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookSendAttemptStore.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookSendAttemptStore.cs @@ -20,7 +20,7 @@ namespace LINGYUN.Abp.Webhooks public Task GetAsync(Guid? tenantId, Guid id) { - return Task.FromResult(default); + return Task.FromResult(default!); } public Task GetSendAttemptCountAsync(Guid? tenantId, Guid webhookId, Guid webhookSubscriptionId) @@ -30,7 +30,7 @@ namespace LINGYUN.Abp.Webhooks public Task HasXConsecutiveFailAsync(Guid? tenantId, Guid subscriptionId, int searchCount) { - return default; + return default!; } public Task<(int TotalCount, IReadOnlyCollection Webhooks)> GetAllSendAttemptsBySubscriptionAsPagedListAsync(Guid? tenantId, Guid subscriptionId, int maxResultCount, diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookSubscriptionsStore.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookSubscriptionsStore.cs index 4214d1d25..29788017e 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookSubscriptionsStore.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/NullWebhookSubscriptionsStore.cs @@ -14,12 +14,12 @@ namespace LINGYUN.Abp.Webhooks public Task GetAsync(Guid id) { - return Task.FromResult(default); + return Task.FromResult(default!); } public WebhookSubscriptionInfo Get(Guid id) { - return default; + return default!; } public Task InsertAsync(WebhookSubscriptionInfo webhookSubscription) diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookManager.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookManager.cs index 5026b866c..9cac2a0ba 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookManager.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookManager.cs @@ -26,23 +26,30 @@ namespace LINGYUN.Abp.Webhooks public async virtual Task GetWebhookPayloadAsync(WebhookSenderArgs webhookSenderArgs) { - var data = JsonConvert.DeserializeObject(webhookSenderArgs.Data); + object? data = null; + if (!webhookSenderArgs.Data.IsNullOrWhiteSpace()) + { + data = JsonConvert.DeserializeObject(webhookSenderArgs.Data); + } var attemptNumber = await WebhookSendAttemptStore.GetSendAttemptCountAsync( webhookSenderArgs.TenantId, webhookSenderArgs.WebhookEventId, webhookSenderArgs.WebhookSubscriptionId); - return new WebhookPayload( + var payload = new WebhookPayload( webhookSenderArgs.WebhookEventId.ToString(), webhookSenderArgs.WebhookName, - attemptNumber) + attemptNumber); + if (data != null) { - Data = data - }; + payload.Data = data; + } + + return payload; } - public virtual void SignWebhookRequest(HttpRequestMessage request, string serializedBody, string secret) + public virtual void SignWebhookRequest(HttpRequestMessage request, string? serializedBody, string? secret) { Check.NotNull(request, nameof(request)); Check.NotNullOrWhiteSpace(serializedBody, nameof(serializedBody)); @@ -58,7 +65,7 @@ namespace LINGYUN.Abp.Webhooks } } - public async virtual Task GetSerializedBodyAsync(WebhookSenderArgs webhookSenderArgs) + public async virtual Task GetSerializedBodyAsync(WebhookSenderArgs webhookSenderArgs) { if (webhookSenderArgs.SendExactSameData) { @@ -79,7 +86,7 @@ namespace LINGYUN.Abp.Webhooks Guid? tenantId, HttpStatusCode? statusCode, string content, - IDictionary requestHeaders = null, - IDictionary responseHeaders = null); + IDictionary? requestHeaders = null, + IDictionary? responseHeaders = null); } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSendAttempt.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSendAttempt.cs index 8189f8f72..b3882a28a 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSendAttempt.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSendAttempt.cs @@ -23,7 +23,7 @@ namespace LINGYUN.Abp.Webhooks /// /// Webhook response content that webhook endpoint send back /// - public string Response { get; set; } + public string? Response { get; set; } /// /// Webhook response status code that webhook endpoint send back diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSenderArgs.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSenderArgs.cs index 76fa20429..21d32b062 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSenderArgs.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSenderArgs.cs @@ -17,12 +17,12 @@ namespace LINGYUN.Abp.Webhooks /// /// Webhook unique name /// - public string WebhookName { get; set; } + public string WebhookName { get; set; } = default!; /// /// Webhook data as JSON string. /// - public string Data { get; set; } + public string? Data { get; set; } //Subscription information @@ -34,12 +34,12 @@ namespace LINGYUN.Abp.Webhooks /// /// Subscription webhook endpoint /// - public string WebhookUri { get; set; } + public string WebhookUri { get; set; } = default!; /// /// Webhook secret /// - public string Secret { get; set; } + public string? Secret { get; set; } /// /// Gets a set of additional HTTP headers.That headers will be sent with the webhook. diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSubscriptionInfo.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSubscriptionInfo.cs index cc9feb623..b7514765c 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSubscriptionInfo.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/WebhookSubscriptionInfo.cs @@ -14,12 +14,12 @@ namespace LINGYUN.Abp.Webhooks /// /// Subscription webhook endpoint /// - public string WebhookUri { get; set; } + public string WebhookUri { get; set; } = default!; /// /// Webhook secret /// - public string Secret { get; set; } + public string? Secret { get; set; } /// /// Is subscription active diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionCreateDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionCreateDto.cs index d4a4219a7..d2dfcb88e 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionCreateDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionCreateDto.cs @@ -8,9 +8,9 @@ public class WebhookDefinitionCreateDto : WebhookDefinitionCreateOrUpdateDto { [Required] [DynamicStringLength(typeof(WebhookDefinitionRecordConsts), nameof(WebhookGroupDefinitionRecordConsts.MaxNameLength))] - public string GroupName { get; set; } + public string GroupName { get; set; } = default!; [Required] [DynamicStringLength(typeof(WebhookDefinitionRecordConsts), nameof(WebhookDefinitionRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionCreateOrUpdateDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionCreateOrUpdateDto.cs index bfccf3089..21910bf40 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionCreateOrUpdateDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionCreateOrUpdateDto.cs @@ -9,10 +9,10 @@ public abstract class WebhookDefinitionCreateOrUpdateDto : IHasExtraProperties { [Required] [DynamicStringLength(typeof(WebhookDefinitionRecordConsts), nameof(WebhookDefinitionRecordConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; [DynamicStringLength(typeof(WebhookDefinitionRecordConsts), nameof(WebhookDefinitionRecordConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } public bool IsEnabled { get; set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionDto.cs index 6a4a8282b..c544f3f9c 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionDto.cs @@ -5,13 +5,13 @@ namespace LINGYUN.Abp.WebhooksManagement.Definitions.Dto; public class WebhookDefinitionDto : IHasExtraProperties { - public string GroupName { get; set; } + public string GroupName { get; set; } = default!; - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; - public string Description { get; set; } + public string? Description { get; set; } public bool IsEnabled { get; set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionGetListInput.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionGetListInput.cs index 06921224e..4b3c2680b 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionGetListInput.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionGetListInput.cs @@ -2,6 +2,6 @@ public class WebhookDefinitionGetListInput { - public string Filter { get; set; } - public string GroupName { get; set; } + public string? Filter { get; set; } + public string? GroupName { get; set; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionUpdateDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionUpdateDto.cs index 9142c37fe..4817f7e68 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionUpdateDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookDefinitionUpdateDto.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.WebhooksManagement.Definitions; public class WebhookDefinitionUpdateDto : WebhookDefinitionCreateOrUpdateDto, IHasConcurrencyStamp { [StringLength(40)] - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionCreateDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionCreateDto.cs index fb6e5a573..f71f9904c 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionCreateDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionCreateDto.cs @@ -6,5 +6,5 @@ public class WebhookGroupDefinitionCreateDto : WebhookGroupDefinitionCreateOrUpd { [Required] [DynamicStringLength(typeof(WebhookGroupDefinitionRecordConsts), nameof(WebhookGroupDefinitionRecordConsts.MaxNameLength))] - public string Name { get; set; } + public string Name { get; set; } = default!; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionCreateOrUpdateDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionCreateOrUpdateDto.cs index 14f3abae7..e85d9a1b1 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionCreateOrUpdateDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionCreateOrUpdateDto.cs @@ -7,7 +7,7 @@ public abstract class WebhookGroupDefinitionCreateOrUpdateDto : IHasExtraPropert { [Required] [DynamicStringLength(typeof(WebhookGroupDefinitionRecordConsts), nameof(WebhookGroupDefinitionRecordConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary(); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionDto.cs index f7560152c..5b9d8f110 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionDto.cs @@ -4,9 +4,9 @@ namespace LINGYUN.Abp.WebhooksManagement.Definitions; public class WebhookGroupDefinitionDto : IHasExtraProperties { - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public bool IsStatic { get; set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionGetListInput.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionGetListInput.cs index 01d7ccda5..61c679ad0 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionGetListInput.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionGetListInput.cs @@ -2,5 +2,5 @@ public class WebhookGroupDefinitionGetListInput { - public string Filter { get; set; } + public string? Filter { get; set; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionUpdateDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionUpdateDto.cs index 947c123f2..d7edf142e 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionUpdateDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/Definitions/Dto/WebhookGroupDefinitionUpdateDto.cs @@ -6,5 +6,5 @@ namespace LINGYUN.Abp.WebhooksManagement.Definitions; public class WebhookGroupDefinitionUpdateDto : WebhookGroupDefinitionCreateOrUpdateDto, IHasConcurrencyStamp { [StringLength(40)] - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookAvailableDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookAvailableDto.cs index 0e4c5ed6d..351cf4ed1 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookAvailableDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookAvailableDto.cs @@ -2,7 +2,7 @@ public class WebhookAvailableDto { - public string Name { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } + public string Name { get; set; } = default!; + public string? DisplayName { get; set; } + public string? Description { get; set; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookAvailableGroupDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookAvailableGroupDto.cs index 37a3c8fe1..f88d65e2d 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookAvailableGroupDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookAvailableGroupDto.cs @@ -4,7 +4,7 @@ namespace LINGYUN.Abp.WebhooksManagement; public class WebhookAvailableGroupDto { - public string Name { get; set; } - public string DisplayName { get; set; } + public string Name { get; set; } = default!; + public string? DisplayName { get; set; } public List Webhooks { get; set; } = new List(); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookEventRecordDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookEventRecordDto.cs index a282777a6..32bd4c385 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookEventRecordDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookEventRecordDto.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.WebhooksManagement; public class WebhookEventRecordDto : EntityDto { public Guid? TenantId { get; set; } - public string WebhookName { get; set; } - public string Data { get; set; } + public string WebhookName { get; set; } = default!; + public string? Data { get; set; } public DateTime CreationTime { get; set; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookPublishInput.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookPublishInput.cs index e27013228..a46aaf2c7 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookPublishInput.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookPublishInput.cs @@ -9,11 +9,11 @@ public class WebhookPublishInput { [Required] [DynamicStringLength(typeof(WebhookEventRecordConsts), nameof(WebhookEventRecordConsts.MaxWebhookNameLength))] - public string WebhookName { get; set; } + public string WebhookName { get; set; } = default!; [Required] [DynamicStringLength(typeof(WebhookEventRecordConsts), nameof(WebhookEventRecordConsts.MaxDataLength))] - public string Data { get; set; } + public string Data { get; set; } = default!; public bool SendExactSameData { get; set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordDto.cs index d315b7353..5c7432b16 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordDto.cs @@ -13,7 +13,7 @@ public class WebhookSendRecordDto : EntityDto public Guid WebhookSubscriptionId { get; set; } - public string Response { get; set; } + public string? Response { get; set; } public HttpStatusCode? ResponseStatusCode { get; set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordGetListInput.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordGetListInput.cs index b96d8cc30..b4e1dc5f2 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordGetListInput.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordGetListInput.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.WebhooksManagement; public class WebhookSendRecordGetListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } public Guid? TenantId { get; set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionCreateOrUpdateInput.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionCreateOrUpdateInput.cs index 4ef11f825..57cc3ef25 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionCreateOrUpdateInput.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionCreateOrUpdateInput.cs @@ -14,20 +14,20 @@ public class WebhookSubscriptionCreateInput : WebhookSubscriptionCreateOrUpdateI public class WebhookSubscriptionUpdateInput : WebhookSubscriptionCreateOrUpdateInput, IHasConcurrencyStamp { [StringLength(40)] - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; } public abstract class WebhookSubscriptionCreateOrUpdateInput { [Required] [DynamicStringLength(typeof(WebhookSubscriptionConsts), nameof(WebhookSubscriptionConsts.MaxWebhookUriLength))] - public string WebhookUri { get; set; } + public string WebhookUri { get; set; } = default!; [DynamicStringLength(typeof(WebhookSubscriptionConsts), nameof(WebhookSubscriptionConsts.MaxSecretLength))] - public string Secret { get; set; } + public string? Secret { get; set; } [DynamicStringLength(typeof(WebhookSubscriptionConsts), nameof(WebhookSubscriptionConsts.MaxDescriptionLength))] - public string Description { get; set; } + public string? Description { get; set; } [DynamicRange( typeof(WebhookSubscriptionConsts), diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionDto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionDto.cs index 3cdfad6c8..b8d2e3f7f 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionDto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionDto.cs @@ -8,12 +8,12 @@ namespace LINGYUN.Abp.WebhooksManagement; public class WebhookSubscriptionDto : CreationAuditedEntityDto, IHasConcurrencyStamp { public Guid? TenantId { get; set; } - public string WebhookUri { get; set; } - public string Secret { get; set; } + public string WebhookUri { get; set; } = default!; + public string? Secret { get; set; } public bool IsActive { get; set; } - public string Description { get; set; } + public string? Description { get; set; } public List Webhooks { get; set; } = new List(); public IDictionary Headers { get; set; } = new Dictionary(); - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } = default!; public int? TimeoutDuration { get; set; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionGetListInput.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionGetListInput.cs index 9e9060184..a32c83fe0 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionGetListInput.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionGetListInput.cs @@ -6,19 +6,19 @@ namespace LINGYUN.Abp.WebhooksManagement; public class WebhookSubscriptionGetListInput : PagedAndSortedResultRequestDto { - public string Filter { get; set; } + public string? Filter { get; set; } public Guid? TenantId { get; set; } [DynamicStringLength(typeof(WebhookSubscriptionConsts), nameof(WebhookSubscriptionConsts.MaxWebhookUriLength))] - public string WebhookUri { get; set; } + public string? WebhookUri { get; set; } [DynamicStringLength(typeof(WebhookSubscriptionConsts), nameof(WebhookSubscriptionConsts.MaxSecretLength))] - public string Secret { get; set; } + public string? Secret { get; set; } public bool? IsActive { get; set; } - public string Webhooks { get; set; } + public string? Webhooks { get; set; } public DateTime? BeginCreationTime { get; set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookDefinitionAppService.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookDefinitionAppService.cs index 493d9ada7..33f1fc5be 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookDefinitionAppService.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookDefinitionAppService.cs @@ -51,7 +51,7 @@ public class WebhookDefinitionAppService : WebhooksManagementAppServiceBase, IWe await _webhookDefinitionRecordRepository.InsertAsync(webhookDefinitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(webhookDefinitionRecord); } @@ -66,7 +66,7 @@ public class WebhookDefinitionAppService : WebhooksManagementAppServiceBase, IWe CheckIsStaticDefinitionRecord(definitionRecord); await _webhookDefinitionRecordRepository.DeleteAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(string name) @@ -111,12 +111,12 @@ public class WebhookDefinitionAppService : WebhooksManagementAppServiceBase, IWe UpdateByInput(definitionRecord, input); definitionRecord = await _webhookDefinitionRecordRepository.UpdateAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(definitionRecord); } - protected async virtual Task FindByNameAsync(string name) + protected async virtual Task FindByNameAsync(string name) { return await _webhookDefinitionRecordRepository.FindByNameAsync(name); } @@ -148,7 +148,7 @@ public class WebhookDefinitionAppService : WebhooksManagementAppServiceBase, IWe record.DisplayName = input.DisplayName; } - string requiredFeatures = null; + string? requiredFeatures = null; if (!input.RequiredFeatures.IsNullOrEmpty()) { requiredFeatures = input.RequiredFeatures.JoinAsString(","); diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookGroupDefinitionAppService.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookGroupDefinitionAppService.cs index e3f260c51..3eb1ba6c0 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookGroupDefinitionAppService.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Definitions/WebhookGroupDefinitionAppService.cs @@ -46,7 +46,7 @@ public class WebhookGroupDefinitionAppService : WebhooksManagementAppServiceBase await _webhookGroupDefinitionRecordRepository.InsertAsync(webhookGroupDefinitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(webhookGroupDefinitionRecord); } @@ -61,7 +61,7 @@ public class WebhookGroupDefinitionAppService : WebhooksManagementAppServiceBase CheckIsStaticDefinitionRecord(definitionRecord); await _webhookGroupDefinitionRecordRepository.DeleteAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); } public async virtual Task GetAsync(string name) @@ -113,12 +113,12 @@ public class WebhookGroupDefinitionAppService : WebhooksManagementAppServiceBase definitionRecord = await _webhookGroupDefinitionRecordRepository.UpdateAsync(definitionRecord); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return DefinitionRecordToDto(definitionRecord); } - protected async virtual Task FindByNameAsync(string name) + protected async virtual Task FindByNameAsync(string name) { return await _webhookGroupDefinitionRecordRepository.FindByNameAsync(name); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSendRecordExtensions.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSendRecordExtensions.cs index c3d0e2c26..e8b0fc790 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSendRecordExtensions.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSendRecordExtensions.cs @@ -37,7 +37,7 @@ public static class WebhookSendRecordExtensions return new Dictionary(); } - return JsonConvert.DeserializeObject>(sendRecord.RequestHeaders); + return JsonConvert.DeserializeObject>(sendRecord.RequestHeaders)!; } public static IDictionary GetResponseHeaders(this WebhookSendRecord sendRecord) @@ -47,6 +47,6 @@ public static class WebhookSendRecordExtensions return new Dictionary(); } - return JsonConvert.DeserializeObject>(sendRecord.ResponseHeaders); + return JsonConvert.DeserializeObject>(sendRecord.ResponseHeaders)!; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs index ccee9325d..9950c0c74 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs @@ -24,7 +24,7 @@ public static class WebhookSubscriptionExtensions }; } - public static string ToSubscribedWebhooksString(this WebhookSubscriptionCreateOrUpdateInput webhookSubscription) + public static string? ToSubscribedWebhooksString(this WebhookSubscriptionCreateOrUpdateInput webhookSubscription) { if (webhookSubscription.Webhooks.Any()) { @@ -34,7 +34,7 @@ public static class WebhookSubscriptionExtensions return null; } - public static string ToWebhookHeadersString(this WebhookSubscriptionCreateOrUpdateInput webhookSubscription) + public static string? ToWebhookHeadersString(this WebhookSubscriptionCreateOrUpdateInput webhookSubscription) { if (webhookSubscription.Headers.Any()) { diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Integration/WebhookPublishIntegrationService.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Integration/WebhookPublishIntegrationService.cs index ab6885084..73628047d 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Integration/WebhookPublishIntegrationService.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Integration/WebhookPublishIntegrationService.cs @@ -21,7 +21,7 @@ public class WebhookPublishIntegrationService : WebhooksManagementAppServiceBase UseOnlyGivenHeaders = input.Header.UseOnlyGivenHeaders, Headers = input.Header.Headers, }; - var inputData = JsonConvert.DeserializeObject(input.Data); + var inputData = JsonConvert.DeserializeObject(input.Data)!; if (input.TenantIds.Any()) { diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookPublishAppService.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookPublishAppService.cs index c6d637e77..db8ad8597 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookPublishAppService.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookPublishAppService.cs @@ -24,7 +24,7 @@ public class WebhookPublishAppService : WebhooksManagementAppServiceBase, IWebho UseOnlyGivenHeaders = input.Header.UseOnlyGivenHeaders, Headers = input.Header.Headers, }; - var inputData = JsonConvert.DeserializeObject(input.Data); + var inputData = JsonConvert.DeserializeObject(input.Data)!; if (input.TenantIds.Any()) { diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordAppService.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordAppService.cs index 2fb424251..e84e3149d 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordAppService.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordAppService.cs @@ -74,7 +74,7 @@ public class WebhookSendRecordAppService : WebhooksManagementAppServiceBase, IWe var headersToSend = new Dictionary(); if (!sendRecord.RequestHeaders.IsNullOrWhiteSpace()) { - headersToSend = JsonConvert.DeserializeObject>(sendRecord.RequestHeaders); + headersToSend = JsonConvert.DeserializeObject>(sendRecord.RequestHeaders)!; } using (CurrentTenant.Change(sendRecord.TenantId)) @@ -126,7 +126,7 @@ public class WebhookSendRecordAppService : WebhooksManagementAppServiceBase, IWe .AndIf(Filter.ResponseStatusCode.HasValue, x => x.ResponseStatusCode == Filter.ResponseStatusCode) .AndIf(Filter.BeginCreationTime.HasValue, x => x.CreationTime >= Filter.BeginCreationTime) .AndIf(Filter.EndCreationTime.HasValue, x => x.CreationTime <= Filter.EndCreationTime) - .AndIf(!Filter.Filter.IsNullOrWhiteSpace(), x => x.Response.Contains(Filter.Filter)); + .AndIf(!Filter.Filter.IsNullOrWhiteSpace(), x => x.Response!.Contains(Filter.Filter!)); } } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionAppService.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionAppService.cs index 9c9f15c9f..6309cab53 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionAppService.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionAppService.cs @@ -47,7 +47,7 @@ public class WebhookSubscriptionAppService : WebhooksManagementAppServiceBase, I subscription = await SubscriptionRepository.InsertAsync(subscription); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return subscription.ToWebhookSubscriptionDto(); } @@ -108,7 +108,7 @@ public class WebhookSubscriptionAppService : WebhooksManagementAppServiceBase, I subscription = await SubscriptionRepository.UpdateAsync(subscription); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork!.SaveChangesAsync(); return subscription.ToWebhookSubscriptionDto(); } @@ -123,19 +123,29 @@ public class WebhookSubscriptionAppService : WebhooksManagementAppServiceBase, I var group = new WebhookAvailableGroupDto { Name = groupDefinition.Name, - DisplayName = groupDefinition.DisplayName?.Localize(StringLocalizerFactory), }; + if (groupDefinition.DisplayName != null) + { + group.DisplayName = groupDefinition.DisplayName.Localize(StringLocalizerFactory); + } foreach (var webhookDefinition in groupDefinition.Webhooks.OrderBy(d => d.Name)) { if (await WebhookDefinitionManager.IsAvailableAsync(CurrentTenant.Id, webhookDefinition.Name)) { - group.Webhooks.Add(new WebhookAvailableDto + var webhook = new WebhookAvailableDto { Name = webhookDefinition.Name, - Description = webhookDefinition.Description?.Localize(StringLocalizerFactory), - DisplayName = webhookDefinition.DisplayName?.Localize(StringLocalizerFactory) - }); + }; + if (webhookDefinition.DisplayName != null) + { + webhook.DisplayName = webhookDefinition.DisplayName.Localize(StringLocalizerFactory); + } + if (webhookDefinition.Description != null) + { + webhook.Description = webhookDefinition.Description.Localize(StringLocalizerFactory); + } + group.Webhooks.Add(webhook); } } @@ -200,9 +210,9 @@ public class WebhookSubscriptionAppService : WebhooksManagementAppServiceBase, I .AndIf(Filter.EndCreationTime.HasValue, x => x.CreationTime <= Filter.EndCreationTime) .AndIf(!Filter.WebhookUri.IsNullOrWhiteSpace(), x => x.WebhookUri == Filter.WebhookUri) .AndIf(!Filter.Secret.IsNullOrWhiteSpace(), x => x.Secret == Filter.Secret) - .AndIf(!Filter.Webhooks.IsNullOrWhiteSpace(), x => x.Webhooks.Contains("\"" + Filter.Webhooks + "\"")) - .AndIf(!Filter.Filter.IsNullOrWhiteSpace(), x => x.WebhookUri.Contains(Filter.Filter) || - x.Secret.Contains(Filter.Filter) || x.Webhooks.Contains(Filter.Filter)); + .AndIf(!Filter.Webhooks.IsNullOrWhiteSpace(), x => x.Webhooks!.Contains("\"" + Filter.Webhooks + "\"")) + .AndIf(!Filter.Filter.IsNullOrWhiteSpace(), x => x.WebhookUri.Contains(Filter.Filter!) || + x.Secret!.Contains(Filter.Filter!) || x.Webhooks!.Contains(Filter.Filter!)); } } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhooksManagementApplicationMappers.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhooksManagementApplicationMappers.cs index 9636fed88..b54786022 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhooksManagementApplicationMappers.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhooksManagementApplicationMappers.cs @@ -31,7 +31,7 @@ public partial class WebhookSendRecordToWebhookSendRecordDtoMapper : MapperBase< } [UserMapping(Ignore = true)] - private static IDictionary TryGetRequestHeaders(string requestHeaders) + private static IDictionary TryGetRequestHeaders(string? requestHeaders) { var result = new Dictionary(); @@ -39,7 +39,7 @@ public partial class WebhookSendRecordToWebhookSendRecordDtoMapper : MapperBase< { try { - result = JsonConvert.DeserializeObject>(requestHeaders); + result = JsonConvert.DeserializeObject>(requestHeaders)!; } catch { } } @@ -48,7 +48,7 @@ public partial class WebhookSendRecordToWebhookSendRecordDtoMapper : MapperBase< } [UserMapping(Ignore = true)] - private static IDictionary TryGetResponseHeaders(string responseHeaders) + private static IDictionary TryGetResponseHeaders(string? responseHeaders) { var result = new Dictionary(); @@ -56,7 +56,7 @@ public partial class WebhookSendRecordToWebhookSendRecordDtoMapper : MapperBase< { try { - result = JsonConvert.DeserializeObject>(responseHeaders); + result = JsonConvert.DeserializeObject>(responseHeaders)!; } catch { } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN/Abp/WebhooksManagement/WebhookEventEto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN/Abp/WebhooksManagement/WebhookEventEto.cs index 12fda5cdf..2d0fe1a6d 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN/Abp/WebhooksManagement/WebhookEventEto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN/Abp/WebhooksManagement/WebhookEventEto.cs @@ -9,5 +9,5 @@ public class WebhookEventEto { public Guid Id { get; set; } public Guid? TenantId { get; set; } - public string WebhookName { get; set; } + public string WebhookName { get; set; } = default!; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionEto.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionEto.cs index d8371b652..c73dfaae9 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionEto.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionEto.cs @@ -12,5 +12,5 @@ public class WebhookSubscriptionEto : IMultiTenant public Guid? TenantId { get; set; } - public string WebhookUri { get; set; } + public string WebhookUri { get; set; } = default!; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DefaultWebhookManager.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DefaultWebhookManager.cs index 5922ba9a5..ac0022f30 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DefaultWebhookManager.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DefaultWebhookManager.cs @@ -57,8 +57,8 @@ public class DefaultWebhookManager : WebhookManager, ITransientDependency Guid? tenantId, HttpStatusCode? statusCode, string content, - IDictionary requestHeaders = null, - IDictionary responseHeaders = null) + IDictionary? requestHeaders = null, + IDictionary? responseHeaders = null) { using (CurrentTenant.Change(tenantId)) { diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStore.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStore.cs index 809d64c3f..a654eab13 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStore.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStore.cs @@ -45,7 +45,7 @@ public class DynamicWebhookDefinitionStore : IDynamicWebhookDefinitionStore, ITr CacheOptions = cacheOptions.Value; } - public async virtual Task GetOrNullAsync(string name) + public async virtual Task GetOrNullAsync(string name) { if (!WebhookManagementOptions.IsDynamicWebhookStoreEnabled) { @@ -73,7 +73,7 @@ public class DynamicWebhookDefinitionStore : IDynamicWebhookDefinitionStore, ITr } } - public async virtual Task GetGroupOrNullAsync(string name) + public async virtual Task GetGroupOrNullAsync(string name) { if (!WebhookManagementOptions.IsDynamicWebhookStoreEnabled) { diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStoreInMemoryCache.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStoreInMemoryCache.cs index 7d4a5a71b..e8a276a7f 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStoreInMemoryCache.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStoreInMemoryCache.cs @@ -17,7 +17,7 @@ public class DynamicWebhookDefinitionStoreInMemoryCache : IDynamicWebhookDefinitionStoreCache, ISingletonDependency { - public string CacheStamp { get; set; } + public string? CacheStamp { get; set; } protected IDictionary WebhookGroupDefinitions { get; } protected IDictionary WebhookDefinitions { get; } @@ -74,7 +74,7 @@ public class DynamicWebhookDefinitionStoreInMemoryCache : return Task.CompletedTask; } - public WebhookDefinition GetWebhookOrNull(string name) + public WebhookDefinition? GetWebhookOrNull(string name) { return WebhookDefinitions.GetOrDefault(name); } @@ -84,7 +84,7 @@ public class DynamicWebhookDefinitionStoreInMemoryCache : return WebhookDefinitions.Values.ToList(); } - public WebhookGroupDefinition GetWebhookGroupOrNull(string name) + public WebhookGroupDefinition? GetWebhookGroupOrNull(string name) { return WebhookGroupDefinitions.GetOrDefault(name); } @@ -98,7 +98,7 @@ public class DynamicWebhookDefinitionStoreInMemoryCache : WebhookGroupDefinition webhookGroup, WebhookDefinitionRecord webhookRecord) { - ILocalizableString description = null; + ILocalizableString? description = null; if (!webhookRecord.Description.IsNullOrWhiteSpace()) { description = LocalizableStringSerializer.Deserialize(webhookRecord.Description); diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs index d59ff4e4e..525d0839e 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.WebhooksManagement.Extensions; public static class WebhookSubscriptionExtensions { - public static string ToSubscribedWebhooksString(this WebhookSubscriptionInfo webhookSubscription) + public static string? ToSubscribedWebhooksString(this WebhookSubscriptionInfo webhookSubscription) { if (webhookSubscription.Webhooks.Any()) { @@ -16,7 +16,7 @@ public static class WebhookSubscriptionExtensions return null; } - public static string ToWebhookHeadersString(this WebhookSubscriptionInfo webhookSubscription) + public static string? ToWebhookHeadersString(this WebhookSubscriptionInfo webhookSubscription) { if (webhookSubscription.Headers.Any()) { diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionInfoExtensions.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionInfoExtensions.cs index fc5acccf4..4e695906a 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionInfoExtensions.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionInfoExtensions.cs @@ -18,7 +18,7 @@ public static class WebhookSubscriptionInfoExtensions return new List(); } - return JsonConvert.DeserializeObject>(webhookSubscription.Webhooks); + return JsonConvert.DeserializeObject>(webhookSubscription.Webhooks)!; } /// @@ -101,7 +101,7 @@ public static class WebhookSubscriptionInfoExtensions return new Dictionary(); } - return JsonConvert.DeserializeObject>(webhookSubscription.Headers); + return JsonConvert.DeserializeObject>(webhookSubscription.Headers)!; } /// diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IDynamicWebhookDefinitionStoreCache.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IDynamicWebhookDefinitionStoreCache.cs index 1df82a549..491c4feaa 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IDynamicWebhookDefinitionStoreCache.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IDynamicWebhookDefinitionStoreCache.cs @@ -8,7 +8,7 @@ namespace LINGYUN.Abp.WebhooksManagement; public interface IDynamicWebhookDefinitionStoreCache { - string CacheStamp { get; set; } + string? CacheStamp { get; set; } SemaphoreSlim SyncSemaphore { get; } @@ -18,11 +18,11 @@ public interface IDynamicWebhookDefinitionStoreCache List webhookGroupRecords, List webhookRecords); - WebhookDefinition GetWebhookOrNull(string name); + WebhookDefinition? GetWebhookOrNull(string name); IReadOnlyList GetWebhooks(); - WebhookGroupDefinition GetWebhookGroupOrNull(string name); + WebhookGroupDefinition? GetWebhookGroupOrNull(string name); IReadOnlyList GetGroups(); } \ No newline at end of file diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionRecordRepository.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionRecordRepository.cs index de89d5dd5..2f3d5116d 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionRecordRepository.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionRecordRepository.cs @@ -9,7 +9,7 @@ namespace LINGYUN.Abp.WebhooksManagement; public interface IWebhookDefinitionRecordRepository : IBasicRepository { - Task FindByNameAsync( + Task FindByNameAsync( string name, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionSerializer.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionSerializer.cs index b66f33292..765c86e07 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionSerializer.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionSerializer.cs @@ -1,4 +1,3 @@ -using JetBrains.Annotations; using LINGYUN.Abp.Webhooks; using System.Collections.Generic; using System.Threading.Tasks; @@ -15,5 +14,5 @@ public interface IWebhookDefinitionSerializer Task SerializeAsync( WebhookDefinition Webhook, - [CanBeNull] WebhookGroupDefinition WebhookGroup); + WebhookGroupDefinition WebhookGroup); } \ No newline at end of file diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookGroupDefinitionRecordRepository.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookGroupDefinitionRecordRepository.cs index 7aa297d86..4199b5fbf 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookGroupDefinitionRecordRepository.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookGroupDefinitionRecordRepository.cs @@ -8,7 +8,7 @@ using Volo.Abp.Specifications; namespace LINGYUN.Abp.WebhooksManagement; public interface IWebhookGroupDefinitionRecordRepository : IBasicRepository { - Task FindByNameAsync( + Task FindByNameAsync( string name, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookSendRecordRepository.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookSendRecordRepository.cs index f33ff3090..3757cb6c4 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookSendRecordRepository.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookSendRecordRepository.cs @@ -15,7 +15,7 @@ public interface IWebhookSendRecordRepository : IRepository> GetListAsync( ISpecification specification, - string sorting = $"{nameof(WebhookSendRecord.CreationTime)} DESC", + string? sorting = $"{nameof(WebhookSendRecord.CreationTime)} DESC", int maxResultCount = 10, int skipCount = 10, bool includeDetails = false, diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookSubscriptionRepository.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookSubscriptionRepository.cs index 7c04cc751..f915d04f5 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookSubscriptionRepository.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookSubscriptionRepository.cs @@ -21,7 +21,7 @@ public interface IWebhookSubscriptionRepository : IRepository> GetListAsync( ISpecification specification, - string sorting = $"{nameof(WebhookSubscription.CreationTime)} DESC", + string? sorting = $"{nameof(WebhookSubscription.CreationTime)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookDefinitionRecord.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookDefinitionRecord.cs index 6c7ed58ec..62703cdb7 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookDefinitionRecord.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookDefinitionRecord.cs @@ -9,17 +9,17 @@ namespace LINGYUN.Abp.WebhooksManagement; [IgnoreMultiTenancy] public class WebhookDefinitionRecord : BasicAggregateRoot, IHasExtraProperties { - public string GroupName { get; set; } + public string GroupName { get; set; } = default!; - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; - public string Description { get; set; } + public string? Description { get; set; } public bool IsEnabled { get; set; } - public string RequiredFeatures { get; set; } + public string? RequiredFeatures { get; set; } public ExtraPropertyDictionary ExtraProperties { get; protected set; } @@ -34,9 +34,9 @@ public class WebhookDefinitionRecord : BasicAggregateRoot, IHasExtraProper string groupName, string name, string displayName, - string description = null, + string? description = null, bool isEnabled = true, - string requiredFeatures = null) + string? requiredFeatures = null) : base(id) { GroupName = Check.NotNullOrWhiteSpace(groupName, nameof(groupName), WebhookGroupDefinitionRecordConsts.MaxNameLength); diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookDefinitionSerializer.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookDefinitionSerializer.cs index 89f1cfc7a..8595d06f1 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookDefinitionSerializer.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookDefinitionSerializer.cs @@ -1,99 +1,110 @@ using LINGYUN.Abp.Webhooks; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Threading.Tasks; -using Volo.Abp.Data; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; -using Volo.Abp.Localization; -using Volo.Abp.SimpleStateChecking; - -namespace LINGYUN.Abp.WebhooksManagement; - -public class WebhookDefinitionSerializer : IWebhookDefinitionSerializer, ITransientDependency -{ - protected ISimpleStateCheckerSerializer StateCheckerSerializer { get; } - protected IGuidGenerator GuidGenerator { get; } - protected ILocalizableStringSerializer LocalizableStringSerializer { get; } - - public WebhookDefinitionSerializer( - IGuidGenerator guidGenerator, - ISimpleStateCheckerSerializer stateCheckerSerializer, - ILocalizableStringSerializer localizableStringSerializer) - { - StateCheckerSerializer = stateCheckerSerializer; - LocalizableStringSerializer = localizableStringSerializer; - GuidGenerator = guidGenerator; - } - - public async Task<(WebhookGroupDefinitionRecord[], WebhookDefinitionRecord[])> - SerializeAsync(IEnumerable webhookGroups) - { - var webhookGroupRecords = new List(); +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; +using Volo.Abp.Localization; +using Volo.Abp.SimpleStateChecking; + +namespace LINGYUN.Abp.WebhooksManagement; + +public class WebhookDefinitionSerializer : IWebhookDefinitionSerializer, ITransientDependency +{ + protected ISimpleStateCheckerSerializer StateCheckerSerializer { get; } + protected IGuidGenerator GuidGenerator { get; } + protected ILocalizableStringSerializer LocalizableStringSerializer { get; } + + public WebhookDefinitionSerializer( + IGuidGenerator guidGenerator, + ISimpleStateCheckerSerializer stateCheckerSerializer, + ILocalizableStringSerializer localizableStringSerializer) + { + StateCheckerSerializer = stateCheckerSerializer; + LocalizableStringSerializer = localizableStringSerializer; + GuidGenerator = guidGenerator; + } + + public async Task<(WebhookGroupDefinitionRecord[], WebhookDefinitionRecord[])> + SerializeAsync(IEnumerable webhookGroups) + { + var webhookGroupRecords = new List(); var webhookRecords = new List(); - foreach (var webhookGroup in webhookGroups) - { - webhookGroupRecords.Add(await SerializeAsync(webhookGroup)); - - foreach (var webhook in webhookGroup.Webhooks) - { - webhookRecords.Add(await SerializeAsync(webhook, webhookGroup)); - } - } - - return (webhookGroupRecords.ToArray(), webhookRecords.ToArray()); - } - - public Task SerializeAsync(WebhookGroupDefinition webhookGroup) - { - using (CultureHelper.Use(CultureInfo.InvariantCulture)) - { - var webhookGroupRecord = new WebhookGroupDefinitionRecord( - GuidGenerator.Create(), - webhookGroup.Name, - LocalizableStringSerializer.Serialize(webhookGroup.DisplayName) - ); - - foreach (var property in webhookGroup.Properties) - { - webhookGroupRecord.SetProperty(property.Key, property.Value); - } - - return Task.FromResult(webhookGroupRecord); - } - } - - public Task SerializeAsync( - WebhookDefinition webhook, - WebhookGroupDefinition webhookGroup) - { - using (CultureHelper.Use(CultureInfo.InvariantCulture)) - { - var webhookRecord = new WebhookDefinitionRecord( - GuidGenerator.Create(), - webhookGroup?.Name, - webhook.Name, - LocalizableStringSerializer.Serialize(webhook.DisplayName), - LocalizableStringSerializer.Serialize(webhook.Description), - true, - SerializeRequiredFeatures(webhook.RequiredFeatures) - ); - - foreach (var property in webhook.Properties) - { - webhookRecord.SetProperty(property.Key, property.Value); - } - - return Task.FromResult(webhookRecord); - } - } - - protected virtual string SerializeRequiredFeatures(List requiredFeatures) - { - return requiredFeatures.Any() - ? requiredFeatures.JoinAsString(",") - : null; - } + foreach (var webhookGroup in webhookGroups) + { + webhookGroupRecords.Add(await SerializeAsync(webhookGroup)); + + foreach (var webhook in webhookGroup.Webhooks) + { + webhookRecords.Add(await SerializeAsync(webhook, webhookGroup)); + } + } + + return (webhookGroupRecords.ToArray(), webhookRecords.ToArray()); + } + + public Task SerializeAsync(WebhookGroupDefinition webhookGroup) + { + using (CultureHelper.Use(CultureInfo.InvariantCulture)) + { + var webhookGroupRecord = new WebhookGroupDefinitionRecord( + GuidGenerator.Create(), + webhookGroup.Name, + LocalizableStringSerializer.Serialize(webhookGroup.DisplayName)! + ); + + foreach (var property in webhookGroup.Properties) + { + webhookGroupRecord.SetProperty(property.Key, property.Value); + } + + return Task.FromResult(webhookGroupRecord); + } + } + + public Task SerializeAsync( + WebhookDefinition webhook, + WebhookGroupDefinition webhookGroup) + { + using (CultureHelper.Use(CultureInfo.InvariantCulture)) + { + var displayName = webhook.Name; + string? description = null; + if (webhook.DisplayName != null) + { + displayName = LocalizableStringSerializer.Serialize(webhook.DisplayName)!; + } + if (webhook.Description != null) + { + description = LocalizableStringSerializer.Serialize(webhook.Description); + } + + var webhookRecord = new WebhookDefinitionRecord( + GuidGenerator.Create(), + webhookGroup.Name, + webhook.Name, + displayName, + description, + true, + SerializeRequiredFeatures(webhook.RequiredFeatures) + ); + + foreach (var property in webhook.Properties) + { + webhookRecord.SetProperty(property.Key, property.Value); + } + + return Task.FromResult(webhookRecord); + } + } + + protected virtual string? SerializeRequiredFeatures(List requiredFeatures) + { + return requiredFeatures.Any() + ? requiredFeatures.JoinAsString(",") + : null; + } } \ No newline at end of file diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookEventRecord.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookEventRecord.cs index a576d6bae..e9953b5f2 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookEventRecord.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookEventRecord.cs @@ -10,8 +10,8 @@ namespace LINGYUN.Abp.WebhooksManagement; public class WebhookEventRecord : Entity, IHasCreationTime, IHasDeletionTime { public virtual Guid? TenantId { get; protected set; } - public virtual string WebhookName { get; protected set; } - public virtual string Data { get; protected set; } + public virtual string WebhookName { get; protected set; } = default!; + public virtual string? Data { get; protected set; } public virtual DateTime CreationTime { get; set; } public virtual DateTime? DeletionTime { get; set; } public virtual bool IsDeleted { get; set; } @@ -22,7 +22,7 @@ public class WebhookEventRecord : Entity, IHasCreationTime, IHasDeletionTi public WebhookEventRecord( Guid id, string webhookName, - string data, + string? data, Guid? tenantId = null) : base(id) { WebhookName = Check.NotNullOrWhiteSpace(webhookName, nameof(webhookName), WebhookEventRecordConsts.MaxWebhookNameLength); diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookGroupDefinitionRecord.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookGroupDefinitionRecord.cs index 134898dd5..a6ddb6673 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookGroupDefinitionRecord.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookGroupDefinitionRecord.cs @@ -13,9 +13,9 @@ public class WebhookGroupDefinitionRecord : BasicAggregateRoot, IHasExtraP [Newtonsoft.Json.JsonIgnore] public override Guid Id { get; protected set; } - public string Name { get; set; } + public string Name { get; set; } = default!; - public string DisplayName { get; set; } + public string DisplayName { get; set; } = default!; public ExtraPropertyDictionary ExtraProperties { get; protected set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSendRecord.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSendRecord.cs index 3e5fc5065..30d6fc9e6 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSendRecord.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSendRecord.cs @@ -17,13 +17,13 @@ public class WebhookSendRecord : Entity, IHasCreationTime, IHasModificatio public virtual Guid WebhookSubscriptionId { get; protected set; } - public virtual string Response { get; protected set; } + public virtual string? Response { get; protected set; } public virtual HttpStatusCode? ResponseStatusCode { get; set; } - public virtual string RequestHeaders { get; protected set; } + public virtual string? RequestHeaders { get; protected set; } - public virtual string ResponseHeaders { get; protected set; } + public virtual string? ResponseHeaders { get; protected set; } public virtual bool SendExactSameData { get; set; } @@ -31,7 +31,7 @@ public class WebhookSendRecord : Entity, IHasCreationTime, IHasModificatio public virtual DateTime? LastModificationTime { get; set; } - public virtual WebhookEventRecord WebhookEvent { get; protected set; } + public virtual WebhookEventRecord WebhookEvent { get; protected set; } = default!; protected WebhookSendRecord() { @@ -50,16 +50,16 @@ public class WebhookSendRecord : Entity, IHasCreationTime, IHasModificatio } public void SetResponse( - string response, + string? response, HttpStatusCode? statusCode = null, - string responseHeaders = null) + string? responseHeaders = null) { Response = Check.Length(response, nameof(response), WebhookSendRecordConsts.MaxResponseLength); ResponseStatusCode = statusCode; ResponseHeaders = Check.Length(responseHeaders, nameof(responseHeaders), WebhookSendRecordConsts.MaxHeadersLength); } - public void SetRequestHeaders(string requestHeaders = null) + public void SetRequestHeaders(string? requestHeaders = null) { RequestHeaders = Check.Length(requestHeaders, nameof(requestHeaders), WebhookSendRecordConsts.MaxHeadersLength); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordFilter.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordFilter.cs index 6421718cf..ae4bbd150 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordFilter.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordFilter.cs @@ -5,7 +5,7 @@ namespace LINGYUN.Abp.WebhooksManagement; public class WebhookSendRecordFilter { - public string Filter { get; set; } + public string? Filter { get; set; } public Guid? TenantId { get; set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscription.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscription.cs index c917f20f6..337b21889 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscription.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscription.cs @@ -10,13 +10,13 @@ namespace LINGYUN.Abp.WebhooksManagement; public class WebhookSubscription : CreationAuditedEntity, IHasConcurrencyStamp { public virtual Guid? TenantId { get; protected set; } - public virtual string WebhookUri { get; protected set; } - public virtual string Secret { get; protected set; } + public virtual string WebhookUri { get; protected set; } = default!; + public virtual string? Secret { get; protected set; } public virtual bool IsActive { get; set; } - public virtual string Webhooks { get; protected set; } - public virtual string Headers { get; protected set; } - public virtual string Description { get; set; } - public virtual string ConcurrencyStamp { get; set; } + public virtual string? Webhooks { get; protected set; } + public virtual string? Headers { get; protected set; } + public virtual string? Description { get; set; } + public virtual string ConcurrencyStamp { get; set; } = default!; public virtual int? TimeoutDuration { get; set; } protected WebhookSubscription() @@ -25,9 +25,9 @@ public class WebhookSubscription : CreationAuditedEntity, IHasConcurrencyS public WebhookSubscription( Guid id, string webhookUri, - string webhooks, - string headers, - string secret = null, + string? webhooks, + string? headers, + string? secret = null, Guid? tenantId = null) : base(id) { SetWebhookUri(webhookUri); @@ -44,7 +44,7 @@ public class WebhookSubscription : CreationAuditedEntity, IHasConcurrencyS TenantId = tenantId; } - public void SetSecret(string secret) + public void SetSecret(string? secret) { Secret = Check.Length(secret, nameof(secret), WebhookSubscriptionConsts.MaxSecretLength); } @@ -54,12 +54,12 @@ public class WebhookSubscription : CreationAuditedEntity, IHasConcurrencyS WebhookUri = Check.NotNullOrWhiteSpace(webhookUri, nameof(webhookUri), WebhookSubscriptionConsts.MaxWebhookUriLength); } - public void SetWebhooks(string webhooks) + public void SetWebhooks(string? webhooks) { Webhooks = Check.Length(webhooks, nameof(webhooks), WebhookSubscriptionConsts.MaxWebhooksLength); } - public void SetHeaders(string headers) + public void SetHeaders(string? headers) { Headers = Check.Length(headers, nameof(headers), WebhookSubscriptionConsts.MaxHeadersLength); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionFilter.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionFilter.cs index adbd92c7d..4744cef63 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionFilter.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionFilter.cs @@ -4,17 +4,17 @@ namespace LINGYUN.Abp.WebhooksManagement; public class WebhookSubscriptionFilter { - public string Filter { get; set; } + public string? Filter { get; set; } public Guid? TenantId { get; set; } - public string WebhookUri { get; set; } + public string? WebhookUri { get; set; } - public string Secret { get; set; } + public string? Secret { get; set; } public bool? IsActive { get; set; } - public string Webhooks { get; set; } + public string? Webhooks { get; set; } public DateTime? BeginCreationTime { get; set; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionsStore.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionsStore.cs index 4a2755922..3fcc4b998 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionsStore.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionsStore.cs @@ -54,7 +54,7 @@ public class WebhookSubscriptionsStore : DomainService, IWebhookSubscriptionsSto queryable = queryable.Where(x => x.TenantId == tenantId && x.IsActive && - x.Webhooks.Contains("\"" + webhookName + "\"")); + x.Webhooks!.Contains("\"" + webhookName + "\"")); var subscriptions = await AsyncExecuter.ToListAsync(queryable); @@ -85,7 +85,7 @@ public class WebhookSubscriptionsStore : DomainService, IWebhookSubscriptionsSto queryable = queryable.Where(x => x.IsActive && tenantIds.Contains(x.TenantId) && - x.Webhooks.Contains("\"" + webhookName + "\"")); + x.Webhooks!.Contains("\"" + webhookName + "\"")); var subscriptions = await AsyncExecuter.ToListAsync(queryable); @@ -131,7 +131,7 @@ public class WebhookSubscriptionsStore : DomainService, IWebhookSubscriptionsSto queryable = queryable.Where(x => x.TenantId == tenantId && x.IsActive && - x.Webhooks.Contains("\"" + webhookName + "\"")); + x.Webhooks!.Contains("\"" + webhookName + "\"")); return await AsyncExecuter.AnyAsync(queryable); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhooksManagementDbProperties.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhooksManagementDbProperties.cs index 33ddda08e..e5ed78e97 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhooksManagementDbProperties.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhooksManagementDbProperties.cs @@ -4,7 +4,7 @@ public static class WebhooksManagementDbProperties { public static string DbTablePrefix { get; set; } = "AbpWebhooks"; - public static string DbSchema { get; set; } = null; + public static string? DbSchema { get; set; } = null; public const string ConnectionStringName = "WebhooksManagement"; diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookDefinitionRecordRepository.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookDefinitionRecordRepository.cs index 1a99b7b0b..58cd97dc5 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookDefinitionRecordRepository.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookDefinitionRecordRepository.cs @@ -20,7 +20,7 @@ public class EfCoreWebhookDefinitionRecordRepository : { } - public async virtual Task FindByNameAsync( + public async virtual Task FindByNameAsync( string name, CancellationToken cancellationToken = default) { diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookGroupDefinitionRecordRepository.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookGroupDefinitionRecordRepository.cs index 4ec518e5a..35dfedd19 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookGroupDefinitionRecordRepository.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookGroupDefinitionRecordRepository.cs @@ -20,7 +20,7 @@ public class EfCoreWebhookGroupDefinitionRecordRepository : { } - public async Task FindByNameAsync( + public async Task FindByNameAsync( string name, CancellationToken cancellationToken = default) { diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookSendRecordRepository.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookSendRecordRepository.cs index 706542a0b..764031250 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookSendRecordRepository.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookSendRecordRepository.cs @@ -33,7 +33,7 @@ public class EfCoreWebhookSendRecordRepository : public async virtual Task> GetListAsync( ISpecification specification, - string sorting = $"{nameof(WebhookSendRecord.CreationTime)} DESC", + string? sorting = $"{nameof(WebhookSendRecord.CreationTime)} DESC", int maxResultCount = 10, int skipCount = 10, bool includeDetails = false, @@ -67,6 +67,6 @@ public class EfCoreWebhookSendRecordRepository : .WhereIf(filter.ResponseStatusCode.HasValue, x => x.ResponseStatusCode == filter.ResponseStatusCode) .WhereIf(filter.BeginCreationTime.HasValue, x => x.CreationTime.CompareTo(filter.BeginCreationTime) >= 0) .WhereIf(filter.EndCreationTime.HasValue, x => x.CreationTime.CompareTo(filter.EndCreationTime) <= 0) - .WhereIf(!filter.Filter.IsNullOrWhiteSpace(), x => x.Response.Contains(filter.Filter)); + .WhereIf(!filter.Filter.IsNullOrWhiteSpace(), x => x.Response!.Contains(filter.Filter!)); } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookSubscriptionRepository.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookSubscriptionRepository.cs index 435fa2c89..42f02387c 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookSubscriptionRepository.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookSubscriptionRepository.cs @@ -30,7 +30,7 @@ public class EfCoreWebhookSubscriptionRepository : return await (await GetDbSetAsync()) .AnyAsync(x => x.TenantId == tenantId && x.WebhookUri == webhookUri && - x.Webhooks.Contains("\"" + webhookName + "\""), + x.Webhooks!.Contains("\"" + webhookName + "\""), GetCancellationToken(cancellationToken)); } @@ -45,7 +45,7 @@ public class EfCoreWebhookSubscriptionRepository : public async virtual Task> GetListAsync( ISpecification specification, - string sorting = $"{nameof(WebhookSubscription.CreationTime)} DESC", + string? sorting = $"{nameof(WebhookSubscription.CreationTime)} DESC", int maxResultCount = 10, int skipCount = 0, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/WebhooksManagementDbContextModelCreatingExtensions.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/WebhooksManagementDbContextModelCreatingExtensions.cs index e8e3a81bb..360c8c29c 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/WebhooksManagementDbContextModelCreatingExtensions.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/WebhooksManagementDbContextModelCreatingExtensions.cs @@ -9,7 +9,7 @@ public static class WebhooksManagementDbContextModelCreatingExtensions { public static void ConfigureWebhooksManagement( this ModelBuilder builder, - Action optionsAction = null) + Action? optionsAction = null) { Check.NotNull(builder, nameof(builder)); diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/WebhooksManagementModelBuilderConfigurationOptions.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/WebhooksManagementModelBuilderConfigurationOptions.cs index dc8a2e564..c6739613b 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/WebhooksManagementModelBuilderConfigurationOptions.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/WebhooksManagementModelBuilderConfigurationOptions.cs @@ -7,7 +7,7 @@ public class WebhooksManagementModelBuilderConfigurationOptions : AbpModelBuilde { public WebhooksManagementModelBuilderConfigurationOptions( [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) + [CanBeNull] string? schema = null) : base( tablePrefix, schema) diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj b/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj index 247c750a9..f29d63bd6 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj +++ b/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj @@ -7,8 +7,7 @@ enable LY.MicroService.Applications.Single A47DB958-CC3F-430B-A18A-57AA535BAB49 - enable - 10.2.0 + 10.6.0 @@ -245,8 +244,6 @@ - - diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs index 7325f337f..eea00c887 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs @@ -161,9 +161,9 @@ namespace LY.MicroService.Applications.Single; // 平台模块 实体框架 typeof(PlatformEntityFrameworkCoreModule), // 平台模块 VueVbenAdmin设置 - typeof(PlatformSettingsVueVbenAdminModule), + // typeof(PlatformSettingsVueVbenAdminModule), // 平台模块 VueVbenAdmin主题 - typeof(PlatformThemeVueVbenAdminModule), + // typeof(PlatformThemeVueVbenAdminModule), // 平台模块 Vben2路由 // typeof(AbpUINavigationVueVbenAdminModule), // 平台模块 Vben5路由 diff --git a/common.props b/common.props index 1556100fa..a5b08dfad 100644 --- a/common.props +++ b/common.props @@ -3,13 +3,14 @@ latest 10.4.0 colin - $(NoWarn);CS1591;CS0436;CS8618;NU1803 + $(NoWarn);CS1591;CS0436;NU1803 https://github.com/colinin/abp-next-admin $(SolutionDir)LocalNuget 10.4.0 MIT git https://github.com/colinin/abp-next-admin + enable true