From 6434ef6b4159715606d14c6c5e37c2dd194dbff9 Mon Sep 17 00:00:00 2001 From: colin Date: Mon, 24 Aug 2026 11:15:36 +0800 Subject: [PATCH] feat: Add `PaltformJobsModule` --- aspnet-core/LINGYUN.MicroService.All.slnx | 1 + aspnet-core/LINGYUN.MicroService.Aspire.slnx | 1 + .../LINGYUN.MicroService.SingleProject.slnx | 1 + ...INGYUN.Abp.MicroService.TaskService.csproj | 2 + .../TaskServiceModule.cs | 4 + .../LINGYUN.Platform.Jobs/FodyWeavers.xml | 3 + .../LINGYUN.Platform.Jobs/FodyWeavers.xsd | 30 ++++++ .../LINGYUN.Platform.Jobs.csproj | 26 +++++ .../Platform/Jobs/LocalizableStatic.cs | 12 +++ .../Jobs/Localization/Resources/en.json | 13 +++ .../Jobs/Localization/Resources/zh-Hans.json | 13 +++ .../Jobs/Messages/EmailMessageRetrySendJob.cs | 101 ++++++++++++++++++ .../Jobs/Messages/SmsMessageRetrySendJob.cs | 101 ++++++++++++++++++ .../Jobs/PlatformJobDefinitionProvider.cs | 22 ++++ .../Platform/Jobs/PlatformJobsModule.cs | 28 +++++ ...LY.MicroService.Applications.Single.csproj | 1 + .../MicroServiceApplicationsSingleModule.cs | 3 + ...Service.TaskManagement.HttpApi.Host.csproj | 2 + .../TaskManagementHttpApiHostModule.cs | 4 + 19 files changed, 368 insertions(+) create mode 100644 aspnet-core/modules/platform/LINGYUN.Platform.Jobs/FodyWeavers.xml create mode 100644 aspnet-core/modules/platform/LINGYUN.Platform.Jobs/FodyWeavers.xsd create mode 100644 aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN.Platform.Jobs.csproj create mode 100644 aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/LocalizableStatic.cs create mode 100644 aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Localization/Resources/en.json create mode 100644 aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Localization/Resources/zh-Hans.json create mode 100644 aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Messages/EmailMessageRetrySendJob.cs create mode 100644 aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Messages/SmsMessageRetrySendJob.cs create mode 100644 aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/PlatformJobDefinitionProvider.cs create mode 100644 aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/PlatformJobsModule.cs diff --git a/aspnet-core/LINGYUN.MicroService.All.slnx b/aspnet-core/LINGYUN.MicroService.All.slnx index 9a41e0d2c..88ae80f90 100644 --- a/aspnet-core/LINGYUN.MicroService.All.slnx +++ b/aspnet-core/LINGYUN.MicroService.All.slnx @@ -422,6 +422,7 @@ + diff --git a/aspnet-core/LINGYUN.MicroService.Aspire.slnx b/aspnet-core/LINGYUN.MicroService.Aspire.slnx index 374089f9c..f49cd2dd6 100644 --- a/aspnet-core/LINGYUN.MicroService.Aspire.slnx +++ b/aspnet-core/LINGYUN.MicroService.Aspire.slnx @@ -417,6 +417,7 @@ + diff --git a/aspnet-core/LINGYUN.MicroService.SingleProject.slnx b/aspnet-core/LINGYUN.MicroService.SingleProject.slnx index da6c9a2ad..68b68b630 100644 --- a/aspnet-core/LINGYUN.MicroService.SingleProject.slnx +++ b/aspnet-core/LINGYUN.MicroService.SingleProject.slnx @@ -342,6 +342,7 @@ + diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService/LINGYUN.Abp.MicroService.TaskService.csproj b/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService/LINGYUN.Abp.MicroService.TaskService.csproj index 2905b7f41..9cf70539f 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService/LINGYUN.Abp.MicroService.TaskService.csproj +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService/LINGYUN.Abp.MicroService.TaskService.csproj @@ -55,6 +55,8 @@ + + diff --git a/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService/TaskServiceModule.cs b/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService/TaskServiceModule.cs index cb0ed473c..c9ce2e0ff 100644 --- a/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService/TaskServiceModule.cs +++ b/aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService/TaskServiceModule.cs @@ -23,6 +23,8 @@ using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using LINGYUN.Abp.Sms.Platform; using LINGYUN.Abp.TaskManagement; using LINGYUN.Abp.TaskManagement.EntityFrameworkCore; +using LINGYUN.Platform.EntityFrameworkCore; +using LINGYUN.Platform.Jobs; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Volo.Abp; @@ -55,6 +57,7 @@ namespace LINGYUN.Abp.MicroService.TaskService; typeof(AbpAspNetCoreMultiTenancyModule), typeof(AbpElasticsearchJobsModule), typeof(AbpIdentityJobsModule), + typeof(PlatformJobsModule), typeof(AbpBackgroundTasksJobsModule), typeof(AbpBackgroundTasksQuartzModule), typeof(AbpBackgroundTasksDistributedLockingModule), @@ -68,6 +71,7 @@ namespace LINGYUN.Abp.MicroService.TaskService; typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSaasEntityFrameworkCoreModule), typeof(AbpLocalizationManagementEntityFrameworkCoreModule), + typeof(PlatformEntityFrameworkCoreModule), typeof(TaskServiceMigrationsEntityFrameworkCoreModule), typeof(AbpBlobStoringBlobManagementModule), typeof(AbpDataDbMigratorModule), diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/FodyWeavers.xml b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/FodyWeavers.xsd b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN.Platform.Jobs.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN.Platform.Jobs.csproj new file mode 100644 index 000000000..929f75ce9 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN.Platform.Jobs.csproj @@ -0,0 +1,26 @@ + + + + + + + net10.0 + LINGYUN.Platform.Jobs + LINGYUN.Platform.Jobs + false + false + false + + + + + + + + + + + + + + diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/LocalizableStatic.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/LocalizableStatic.cs new file mode 100644 index 000000000..3d7dff0f8 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/LocalizableStatic.cs @@ -0,0 +1,12 @@ +using LINGYUN.Platform.Localization; +using Volo.Abp.Localization; + +namespace LINGYUN.Platform.Jobs; + +internal static class LocalizableStatic +{ + public static ILocalizableString Create(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Localization/Resources/en.json b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Localization/Resources/en.json new file mode 100644 index 000000000..389e88ac1 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Localization/Resources/en.json @@ -0,0 +1,13 @@ +{ + "culture": "en", + "texts": { + "SmsMessageRetrySendJob": "Re-sending of SMS message job", + "EmailMessageRetrySendJob": "Re-sending of Email message job", + "DisplayName:RecentSnedFailedHours": "The latest failure in sending occurred at", + "Description:RecentSnedFailedHours": "Recent failure sending time, unit: hours, default: 2 hours.", + "DisplayName:PropertyMaxOfFailedAttempts": "Maximum number of failure attempts", + "Description:PropertyMaxOfFailedAttempts": "Maximum number of failures, default: 3.", + "DisplayName:PropertyPollingBatchCount": "Polling batch count", + "Description:PropertyPollingBatchCount": "Polling batch count, default: 100." + } +} diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Localization/Resources/zh-Hans.json b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Localization/Resources/zh-Hans.json new file mode 100644 index 000000000..6d47d74df --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Localization/Resources/zh-Hans.json @@ -0,0 +1,13 @@ +{ + "culture": "zh-Hans", + "texts": { + "SmsMessageRetrySendJob": "短信重新发送作业", + "EmailMessageRetrySendJob": "邮件重新发送作业", + "DisplayName:RecentSnedFailedHours": "最近发送失败时间", + "Description:RecentSnedFailedHours": "最近发送失败时间, 单位: 小时, 默认: 2.", + "DisplayName:PropertyMaxOfFailedAttempts": "失败次数上限", + "Description:PropertyMaxOfFailedAttempts": "失败次数上限, 默认: 3.", + "DisplayName:PropertyPollingBatchCount": "轮询批次数量", + "Description:PropertyPollingBatchCount": "轮询批次数量, 默认: 100." + } +} diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Messages/EmailMessageRetrySendJob.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Messages/EmailMessageRetrySendJob.cs new file mode 100644 index 000000000..e05b7abfb --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Messages/EmailMessageRetrySendJob.cs @@ -0,0 +1,101 @@ +using LINGYUN.Abp.BackgroundTasks; +using LINGYUN.Platform.Messages; +using Microsoft.Extensions.Logging; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Auditing; +using Volo.Abp.DistributedLocking; +using Volo.Abp.Specifications; +using Volo.Abp.Timing; + +namespace LINGYUN.Platform.Jobs.Messages; +/// +/// 邮件重新发送作业 +/// +[DisableAuditing] +[DisableJobAction] +public class EmailMessageRetrySendJob : IJobRunnable +{ + public const string Name = "EmailMessageRetrySendJob"; + + #region Definition Paramters + + public readonly static IReadOnlyList Paramters = + new List + { + new JobDefinitionParamter( + PropertyRecentSnedFailedHours, + LocalizableStatic.Create("DisplayName:RecentSnedFailedHours"), + LocalizableStatic.Create("Description:RecentSnedFailedHours")), + new JobDefinitionParamter( + PropertyMaxOfFailedAttempts, + LocalizableStatic.Create("DisplayName:PropertyMaxOfFailedAttempts"), + LocalizableStatic.Create("Description:PropertyMaxOfFailedAttempts")), + new JobDefinitionParamter( + PropertyPollingBatchCount, + LocalizableStatic.Create("DisplayName:PropertyPollingBatchCount"), + LocalizableStatic.Create("Description:PropertyPollingBatchCount")), + }; + + #endregion + /// + /// 最近发送失败时间, 单位: 小时, 默认: 2 + /// + public const string PropertyRecentSnedFailedHours = "RecentSnedFailedHours"; + /// + /// 失败次数上限, 默认: 3 + /// + public const string PropertyMaxOfFailedAttempts = "MaxOfFailedAttempts"; + /// + /// 轮询批次数量, 默认: 100 + /// + public const string PropertyPollingBatchCount = "PollingBatchCount"; + + public async virtual Task ExecuteAsync(JobRunnableContext context) + { + var logger = context.GetRequiredService>(); + + var distributedLock = context.GetRequiredService(); + var distributedLockKey = nameof(EmailMessageRetrySendJob); + await using var jobLockHandle = await distributedLock.TryAcquireAsync(distributedLockKey); + if (jobLockHandle == null) + { + logger.LogWarning("Handle is null because of the locking for : {distributedLockKey}", distributedLockKey); + return; + } + + logger.LogDebug("Lock is acquired for {distributedLockKey}.", distributedLockKey); + + var clock = context.GetRequiredService(); + var emailMessageManager = context.GetRequiredService(); + var emailMessageRepo = context.GetRequiredService(); + + var recentSnedFailedHours = context.GetOrDefaultJobData(PropertyRecentSnedFailedHours, 2); + var maxOfFailedAttempts = context.GetOrDefaultJobData(PropertyMaxOfFailedAttempts, 3); + var pollingBatchCount = context.GetOrDefaultJobData(PropertyPollingBatchCount, 100); + var sendTime = clock.Now.AddHours(-recentSnedFailedHours); + + var recentSnedFailedMessages = await emailMessageRepo.GetListAsync( + new ExpressionSpecification(x => x.Status == MessageStatus.Failed && + x.SendCount < maxOfFailedAttempts && x.SendTime >= sendTime), + maxResultCount: pollingBatchCount); + + if (recentSnedFailedMessages.Count > 0) + { + logger.LogDebug("In the last {Hour} hours, a total of {Count} Email messages need to be resent.", recentSnedFailedHours, recentSnedFailedMessages.Count); + + foreach (var message in recentSnedFailedMessages) + { + await emailMessageManager.SendAsync(message); + } + + await emailMessageRepo.UpdateManyAsync(recentSnedFailedMessages); + } + else + { + logger.LogDebug($"There are no Email messages that need to be resent."); + } + + logger.LogDebug($"The batch retry operation of the Email messages has been successfully completed."); + } +} diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Messages/SmsMessageRetrySendJob.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Messages/SmsMessageRetrySendJob.cs new file mode 100644 index 000000000..7ee6cacbb --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/Messages/SmsMessageRetrySendJob.cs @@ -0,0 +1,101 @@ +using LINGYUN.Abp.BackgroundTasks; +using LINGYUN.Platform.Messages; +using Microsoft.Extensions.Logging; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Auditing; +using Volo.Abp.DistributedLocking; +using Volo.Abp.Specifications; +using Volo.Abp.Timing; + +namespace LINGYUN.Platform.Jobs.Messages; +/// +/// 短信重新发送作业 +/// +[DisableAuditing] +[DisableJobAction] +public class SmsMessageRetrySendJob : IJobRunnable +{ + public const string Name = "SmsMessageRetrySendJob"; + + #region Definition Paramters + + public readonly static IReadOnlyList Paramters = + new List + { + new JobDefinitionParamter( + PropertyRecentSnedFailedHours, + LocalizableStatic.Create("DisplayName:RecentSnedFailedHours"), + LocalizableStatic.Create("Description:RecentSnedFailedHours")), + new JobDefinitionParamter( + PropertyMaxOfFailedAttempts, + LocalizableStatic.Create("DisplayName:PropertyMaxOfFailedAttempts"), + LocalizableStatic.Create("Description:PropertyMaxOfFailedAttempts")), + new JobDefinitionParamter( + PropertyPollingBatchCount, + LocalizableStatic.Create("DisplayName:PropertyPollingBatchCount"), + LocalizableStatic.Create("Description:PropertyPollingBatchCount")), + }; + + #endregion + /// + /// 最近发送失败时间, 单位: 小时, 默认: 2 + /// + public const string PropertyRecentSnedFailedHours = "RecentSnedFailedHours"; + /// + /// 失败次数上限, 默认: 3 + /// + public const string PropertyMaxOfFailedAttempts = "MaxOfFailedAttempts"; + /// + /// 轮询批次数量, 默认: 100 + /// + public const string PropertyPollingBatchCount = "PollingBatchCount"; + + public async virtual Task ExecuteAsync(JobRunnableContext context) + { + var logger = context.GetRequiredService>(); + + var distributedLock = context.GetRequiredService(); + var distributedLockKey = nameof(SmsMessageRetrySendJob); + await using var jobLockHandle = await distributedLock.TryAcquireAsync(distributedLockKey); + if (jobLockHandle == null) + { + logger.LogWarning("Handle is null because of the locking for : {distributedLockKey}", distributedLockKey); + return; + } + + logger.LogDebug("Lock is acquired for {distributedLockKey}.", distributedLockKey); + + var clock = context.GetRequiredService(); + var smsMessageManager = context.GetRequiredService(); + var smsMessageRepo = context.GetRequiredService(); + + var recentSnedFailedHours = context.GetOrDefaultJobData(PropertyRecentSnedFailedHours, 2); + var maxOfFailedAttempts = context.GetOrDefaultJobData(PropertyMaxOfFailedAttempts, 3); + var pollingBatchCount = context.GetOrDefaultJobData(PropertyPollingBatchCount, 100); + var sendTime = clock.Now.AddHours(-recentSnedFailedHours); + + var recentSnedFailedMessages = await smsMessageRepo.GetListAsync( + new ExpressionSpecification(x => x.Status == MessageStatus.Failed && + x.SendCount < maxOfFailedAttempts && x.SendTime >= sendTime), + maxResultCount: pollingBatchCount); + + if (recentSnedFailedMessages.Count > 0) + { + logger.LogDebug("In the last {Hour} hours, a total of {Count} SMS messages need to be resent.", recentSnedFailedHours, recentSnedFailedMessages.Count); + + foreach (var message in recentSnedFailedMessages) + { + await smsMessageManager.SendAsync(message); + } + + await smsMessageRepo.UpdateManyAsync(recentSnedFailedMessages); + } + else + { + logger.LogDebug($"There are no SMS messages that need to be resent."); + } + + logger.LogDebug($"The batch retry operation of the SMS messages has been successfully completed."); + } +} diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/PlatformJobDefinitionProvider.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/PlatformJobDefinitionProvider.cs new file mode 100644 index 000000000..30f825535 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/PlatformJobDefinitionProvider.cs @@ -0,0 +1,22 @@ +using LINGYUN.Abp.BackgroundTasks; +using LINGYUN.Platform.Jobs.Messages; + +namespace LINGYUN.Platform.Jobs; +public class IdentityJobDefinitionProvider : JobDefinitionProvider +{ + public override void Define(IJobDefinitionContext context) + { + context.Add( + new JobDefinition( + EmailMessageRetrySendJob.Name, + typeof(EmailMessageRetrySendJob), + LocalizableStatic.Create("EmailMessageRetrySendJob"), + EmailMessageRetrySendJob.Paramters), + new JobDefinition( + SmsMessageRetrySendJob.Name, + typeof(SmsMessageRetrySendJob), + LocalizableStatic.Create("SmsMessageRetrySendJob"), + SmsMessageRetrySendJob.Paramters) + ); + } +} diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/PlatformJobsModule.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/PlatformJobsModule.cs new file mode 100644 index 000000000..37fc42c43 --- /dev/null +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Jobs/LINGYUN/Platform/Jobs/PlatformJobsModule.cs @@ -0,0 +1,28 @@ +using LINGYUN.Platform.Localization; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace LINGYUN.Platform.Jobs; + +[DependsOn( + typeof(AbpBackgroundJobsAbstractionsModule), + typeof(PlatformDomainModule))] +public class PlatformJobsModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Platform/Jobs/Localization/Resources"); + }); + } +} 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 f29d63bd6..41a8398ab 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 @@ -203,6 +203,7 @@ + diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs index 63b96919b..98f7a4524 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs @@ -3,6 +3,7 @@ using LINGYUN.Abp.Identity.AspNetCore; using LINGYUN.Abp.Identity.Jobs; using LINGYUN.Abp.Logging.Serilog.Elasticsearch; using LINGYUN.Abp.Notifications.Calendar; +using LINGYUN.Platform.Jobs; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; namespace LY.MicroService.Applications.Single; @@ -276,6 +277,8 @@ namespace LY.MicroService.Applications.Single; typeof(AbpBackgroundTasksQuartzModule), // 后台任务模块 身份认证模块作业 typeof(AbpIdentityJobsModule), + // 后台任务模块 平台管理模块作业 + typeof(PlatformJobsModule), // 数据审计模块 应用服务 typeof(AbpDataProtectionManagementApplicationModule), diff --git a/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/LY.MicroService.TaskManagement.HttpApi.Host.csproj b/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/LY.MicroService.TaskManagement.HttpApi.Host.csproj index 8f961e343..13cafbe15 100644 --- a/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/LY.MicroService.TaskManagement.HttpApi.Host.csproj +++ b/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/LY.MicroService.TaskManagement.HttpApi.Host.csproj @@ -61,6 +61,8 @@ + + diff --git a/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.cs b/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.cs index 07baef6b6..42b73945b 100644 --- a/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.cs +++ b/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.cs @@ -25,6 +25,8 @@ using LINGYUN.Abp.TaskManagement; using LINGYUN.Abp.TaskManagement.EntityFrameworkCore; using LINGYUN.Abp.Telemetry.OpenTelemetry; using LINGYUN.Abp.Telemetry.SkyWalking; +using LINGYUN.Platform.EntityFrameworkCore; +using LINGYUN.Platform.Jobs; using LY.MicroService.TaskManagement.EntityFrameworkCore; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -65,6 +67,7 @@ namespace LY.MicroService.TaskManagement; typeof(AbpBackgroundTasksNotificationsModule), typeof(AbpElasticsearchJobsModule), typeof(AbpIdentityJobsModule), + typeof(PlatformJobsModule), typeof(TaskManagementApplicationModule), typeof(TaskManagementHttpApiModule), typeof(TaskManagementEntityFrameworkCoreModule), @@ -74,6 +77,7 @@ namespace LY.MicroService.TaskManagement; typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSaasEntityFrameworkCoreModule), typeof(AbpLocalizationManagementEntityFrameworkCoreModule), + typeof(PlatformEntityFrameworkCoreModule), typeof(TaskManagementMigrationsEntityFrameworkCoreModule), typeof(AbpDataDbMigratorModule), typeof(AbpCachingStackExchangeRedisModule),