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>
<PropertyGroup>
<VoloAbpPackageVersion>5.3.0</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>5.3.0</LINGYUNAbpPackageVersion>
<VoloAbpPackageVersion>5.3.2</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>5.3.2</LINGYUNAbpPackageVersion>
<DaprPackageVersion>1.7.0</DaprPackageVersion>
<DistributedLockRedisPackageVersion>1.0.1</DistributedLockRedisPackageVersion>
<DotNetCoreCAPPackageVersion>6.0.1</DotNetCoreCAPPackageVersion>

2
aspnet-core/common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>5.3.0</Version>
<Version>5.3.2</Version>
<Authors>colin</Authors>
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
<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
{
@ -17,11 +18,18 @@ namespace LINGYUN.Abp.Notifications
/// 可以自定义某个通知的格式
/// </summary>
public NotificationDataMappingDictionary NotificationDataMappings { get; }
/// <summary>
/// 过期时间
/// 默认60天
/// </summary>
public TimeSpan ExpirationTime { get; set; }
public AbpNotificationOptions()
{
PublishProviders = new TypeList<INotificationPublishProvider>();
DefinitionProviders = new TypeList<INotificationDefinitionProvider>();
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.Notifications;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
@ -32,6 +33,8 @@ namespace LINGYUN.Abp.MessageService.Notifications
private readonly IUserSubscribeRepository _userSubscribeRepository;
private readonly AbpNotificationOptions _options;
public NotificationStore(
IClock clock,
IObjectMapper objectMapper,
@ -39,7 +42,8 @@ namespace LINGYUN.Abp.MessageService.Notifications
IUnitOfWorkManager unitOfWorkManager,
INotificationRepository notificationRepository,
IUserSubscribeRepository userSubscribeRepository,
IUserNotificationRepository userNotificationRepository
IUserNotificationRepository userNotificationRepository,
IOptions<AbpNotificationOptions> options
)
{
_clock = clock;
@ -49,6 +53,8 @@ namespace LINGYUN.Abp.MessageService.Notifications
_notificationRepository = notificationRepository;
_userSubscribeRepository = userSubscribeRepository;
_userNotificationRepository = userNotificationRepository;
_options = options.Value;
}
public virtual async Task ChangeUserNotificationReadStateAsync(
@ -336,7 +342,7 @@ namespace LINGYUN.Abp.MessageService.Notifications
CreationTime = _clock.Now,
Type = notification.Type,
// TODO: 通知过期时间应该可以配置
ExpirationTime = _clock.Now.AddDays(60)
ExpirationTime = _clock.Now.Add(_options.ExpirationTime)
};
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)
{
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)
.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.MergedJobDataMap.TryGetValue(nameof(JobInfo.TriggerCount), out var count) &&
int.TryParse(count?.ToString(), out var triggerCount))
{
context.Put(nameof(JobInfo.TriggerCount), triggerCount + simpleTrigger.TimesTriggered);
}
// 增量数据写入临时数据, 仅对长期作业有效, 一次性作业永远为1
context.Put(nameof(JobInfo.TriggerCount), simpleTrigger.TimesTriggered);
}
using var scope = ServiceScopeFactory.CreateScope();
@ -76,6 +72,9 @@ public class QuartzJobListener : JobListenerSupport, ISingletonDependency
Result = context.Result?.ToString()
};
context.TryGetMultiTenantId(out var tenantId);
jobEventData.TenantId = tenantId;
var eventContext = new JobEventContext(
scope.ServiceProvider,
jobEventData);

2
common.props

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

4
gateways/Directory.Build.props

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

2
gateways/common.props

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