Browse Source

upgrade abp framework to 5.3.2

pull/628/head
cKey 3 years ago
parent
commit
23bb0a177c
  1. 4
      aspnet-core/Directory.Build.props
  2. 2
      aspnet-core/common.props
  3. 10
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationOptions.cs
  4. 10
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationStore.cs
  5. 3
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreNotificationRepository.cs
  6. 11
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs
  7. 2
      common.props
  8. 4
      gateways/Directory.Build.props
  9. 2
      gateways/common.props

4
aspnet-core/Directory.Build.props

@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<VoloAbpPackageVersion>5.3.0</VoloAbpPackageVersion> <VoloAbpPackageVersion>5.3.2</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>5.3.0</LINGYUNAbpPackageVersion> <LINGYUNAbpPackageVersion>5.3.2</LINGYUNAbpPackageVersion>
<DaprPackageVersion>1.7.0</DaprPackageVersion> <DaprPackageVersion>1.7.0</DaprPackageVersion>
<DistributedLockRedisPackageVersion>1.0.1</DistributedLockRedisPackageVersion> <DistributedLockRedisPackageVersion>1.0.1</DistributedLockRedisPackageVersion>
<DotNetCoreCAPPackageVersion>6.0.1</DotNetCoreCAPPackageVersion> <DotNetCoreCAPPackageVersion>6.0.1</DotNetCoreCAPPackageVersion>

2
aspnet-core/common.props

@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Version>5.3.0</Version> <Version>5.3.2</Version>
<Authors>colin</Authors> <Authors>colin</Authors>
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn> <NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
<PackageProjectUrl>https://github.com/colinin/abp-next-admin</PackageProjectUrl> <PackageProjectUrl>https://github.com/colinin/abp-next-admin</PackageProjectUrl>

10
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationOptions.cs

@ -1,4 +1,5 @@
using Volo.Abp.Collections; using System;
using Volo.Abp.Collections;
namespace LINGYUN.Abp.Notifications namespace LINGYUN.Abp.Notifications
{ {
@ -17,11 +18,18 @@ namespace LINGYUN.Abp.Notifications
/// 可以自定义某个通知的格式 /// 可以自定义某个通知的格式
/// </summary> /// </summary>
public NotificationDataMappingDictionary NotificationDataMappings { get; } public NotificationDataMappingDictionary NotificationDataMappings { get; }
/// <summary>
/// 过期时间
/// 默认60天
/// </summary>
public TimeSpan ExpirationTime { get; set; }
public AbpNotificationOptions() public AbpNotificationOptions()
{ {
PublishProviders = new TypeList<INotificationPublishProvider>(); PublishProviders = new TypeList<INotificationPublishProvider>();
DefinitionProviders = new TypeList<INotificationDefinitionProvider>(); DefinitionProviders = new TypeList<INotificationDefinitionProvider>();
NotificationDataMappings = new NotificationDataMappingDictionary(); NotificationDataMappings = new NotificationDataMappingDictionary();
ExpirationTime = TimeSpan.FromDays(60);
} }
} }
} }

10
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationStore.cs

@ -1,6 +1,7 @@
using LINGYUN.Abp.MessageService.Subscriptions; using LINGYUN.Abp.MessageService.Subscriptions;
using LINGYUN.Abp.Notifications; using LINGYUN.Abp.Notifications;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -32,6 +33,8 @@ namespace LINGYUN.Abp.MessageService.Notifications
private readonly IUserSubscribeRepository _userSubscribeRepository; private readonly IUserSubscribeRepository _userSubscribeRepository;
private readonly AbpNotificationOptions _options;
public NotificationStore( public NotificationStore(
IClock clock, IClock clock,
IObjectMapper objectMapper, IObjectMapper objectMapper,
@ -39,7 +42,8 @@ namespace LINGYUN.Abp.MessageService.Notifications
IUnitOfWorkManager unitOfWorkManager, IUnitOfWorkManager unitOfWorkManager,
INotificationRepository notificationRepository, INotificationRepository notificationRepository,
IUserSubscribeRepository userSubscribeRepository, IUserSubscribeRepository userSubscribeRepository,
IUserNotificationRepository userNotificationRepository IUserNotificationRepository userNotificationRepository,
IOptions<AbpNotificationOptions> options
) )
{ {
_clock = clock; _clock = clock;
@ -49,6 +53,8 @@ namespace LINGYUN.Abp.MessageService.Notifications
_notificationRepository = notificationRepository; _notificationRepository = notificationRepository;
_userSubscribeRepository = userSubscribeRepository; _userSubscribeRepository = userSubscribeRepository;
_userNotificationRepository = userNotificationRepository; _userNotificationRepository = userNotificationRepository;
_options = options.Value;
} }
public virtual async Task ChangeUserNotificationReadStateAsync( public virtual async Task ChangeUserNotificationReadStateAsync(
@ -336,7 +342,7 @@ namespace LINGYUN.Abp.MessageService.Notifications
CreationTime = _clock.Now, CreationTime = _clock.Now,
Type = notification.Type, Type = notification.Type,
// TODO: 通知过期时间应该可以配置 // TODO: 通知过期时间应该可以配置
ExpirationTime = _clock.Now.AddDays(60) ExpirationTime = _clock.Now.Add(_options.ExpirationTime)
}; };
await _notificationRepository.InsertAsync(notify, cancellationToken: cancellationToken); await _notificationRepository.InsertAsync(notify, cancellationToken: cancellationToken);

3
aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreNotificationRepository.cs

@ -25,7 +25,8 @@ namespace LINGYUN.Abp.MessageService.Notifications
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
return await (await GetDbSetAsync()) return await (await GetDbSetAsync())
.Where(x => x.ExpirationTime.Value.CompareTo(DateTime.Now) <= 0) .Where(x => x.ExpirationTime < DateTime.Now)
.OrderBy(x => x.ExpirationTime)
.Take(batchCount) .Take(batchCount)
.ToListAsync(GetCancellationToken(cancellationToken)); .ToListAsync(GetCancellationToken(cancellationToken));
} }

11
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN/Abp/BackgroundTasks/Quartz/QuartzJobListener.cs

@ -57,12 +57,8 @@ public class QuartzJobListener : JobListenerSupport, ISingletonDependency
if (context.Trigger is ISimpleTrigger simpleTrigger) if (context.Trigger is ISimpleTrigger simpleTrigger)
{ {
// 增量数据写入临时数据 // 增量数据写入临时数据, 仅对长期作业有效, 一次性作业永远为1
if (context.MergedJobDataMap.TryGetValue(nameof(JobInfo.TriggerCount), out var count) && context.Put(nameof(JobInfo.TriggerCount), simpleTrigger.TimesTriggered);
int.TryParse(count?.ToString(), out var triggerCount))
{
context.Put(nameof(JobInfo.TriggerCount), triggerCount + simpleTrigger.TimesTriggered);
}
} }
using var scope = ServiceScopeFactory.CreateScope(); using var scope = ServiceScopeFactory.CreateScope();
@ -76,6 +72,9 @@ public class QuartzJobListener : JobListenerSupport, ISingletonDependency
Result = context.Result?.ToString() Result = context.Result?.ToString()
}; };
context.TryGetMultiTenantId(out var tenantId);
jobEventData.TenantId = tenantId;
var eventContext = new JobEventContext( var eventContext = new JobEventContext(
scope.ServiceProvider, scope.ServiceProvider,
jobEventData); jobEventData);

2
common.props

@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Version>5.3.0</Version> <Version>5.3.2</Version>
<Authors>LINGYUN</Authors> <Authors>LINGYUN</Authors>
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn> <NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
<PackageProjectUrl>https://github.com/colinin/abp-next-admin</PackageProjectUrl> <PackageProjectUrl>https://github.com/colinin/abp-next-admin</PackageProjectUrl>

4
gateways/Directory.Build.props

@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<VoloAbpPackageVersion>5.3.0</VoloAbpPackageVersion> <VoloAbpPackageVersion>5.3.2</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>5.3.0</LINGYUNAbpPackageVersion> <LINGYUNAbpPackageVersion>5.3.2</LINGYUNAbpPackageVersion>
<DaprPackageVersion>1.7.0</DaprPackageVersion> <DaprPackageVersion>1.7.0</DaprPackageVersion>
<DotNetCoreCAPPackageVersion>6.0.1</DotNetCoreCAPPackageVersion> <DotNetCoreCAPPackageVersion>6.0.1</DotNetCoreCAPPackageVersion>
<AliyunSDKPackageVersion>1.5.10</AliyunSDKPackageVersion> <AliyunSDKPackageVersion>1.5.10</AliyunSDKPackageVersion>

2
gateways/common.props

@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Version>5.3.0</Version> <Version>5.3.2</Version>
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn> <NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
Loading…
Cancel
Save