Browse Source

Merge pull request #813 from colinin/enhance

Enhanced commit
pull/819/head
yx lin 3 years ago
committed by GitHub
parent
commit
855994ed8c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      apps/vue/src/views/task-management/background-jobs/components/JobTable.vue
  2. 6
      aspnet-core/modules/lt/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/ILocalizationDbContext.cs
  3. 11
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/IMessageServiceDbContext.cs
  4. 11
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContext.cs
  5. 57
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserNotificationRepository.cs
  6. 9
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/INotificationsDbContext.cs
  7. 7
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContext.cs
  8. 13
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/IPlatformDbContext.cs
  9. 14
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContext.cs
  10. 5
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/ITaskManagementDbContext.cs
  11. 3
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/TaskManagementDbContext.cs
  12. 40
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordAppService.cs
  13. 32
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/System/Linq/Expressions/ExpressionFuncExtensions.cs
  14. 7
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookSendRecordRepository.cs
  15. 28
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSendAttemptStore.cs
  16. 32
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/System/Linq/Expressions/ExpressionFuncExtensions.cs
  17. 20
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookSendRecordRepository.cs
  18. 6
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/IWebhooksManagementDbContext.cs
  19. 3
      aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/WebhooksManagementDbContext.cs
  20. 8
      aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs
  21. 2
      aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs
  22. 7
      aspnet-core/services/LY.MicroService.Applications.Single/appsettings.json
  23. 8
      aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.Configure.cs
  24. 2
      aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.cs
  25. 7
      aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/appsettings.json
  26. 8
      aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs
  27. 2
      aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs
  28. 7
      aspnet-core/services/LY.MicroService.AuthServer/appsettings.json
  29. 8
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.Configure.cs
  30. 2
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.cs
  31. 7
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/appsettings.json
  32. 8
      aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.Configure.cs
  33. 2
      aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.cs
  34. 7
      aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/appsettings.json
  35. 8
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.Configure.cs
  36. 2
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.cs
  37. 7
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/appsettings.json
  38. 8
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.Configure.cs
  39. 2
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs
  40. 7
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.json
  41. 10
      aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.Configure.cs
  42. 2
      aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.cs
  43. 12
      aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/appsettings.json
  44. 10
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.Configure.cs
  45. 2
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.cs
  46. 12
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/appsettings.json
  47. 10
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.Configure.cs
  48. 2
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs
  49. 12
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/appsettings.json
  50. 8
      aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/IdentityServerHttpApiHostModule.Configure.cs
  51. 2
      aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/IdentityServerHttpApiHostModule.cs
  52. 7
      aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/appsettings.json
  53. 8
      aspnet-core/services/LY.MicroService.identityServer/IdentityServerModule.Configure.cs
  54. 2
      aspnet-core/services/LY.MicroService.identityServer/IdentityServerModule.cs
  55. 7
      aspnet-core/services/LY.MicroService.identityServer/appsettings.json
  56. 12
      aspnet-core/templates/content/host/PackageName.CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.Configure.cs
  57. 2
      aspnet-core/templates/content/host/PackageName.CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs
  58. 12
      aspnet-core/templates/content/host/PackageName.CompanyName.ProjectName.HttpApi.Host/appsettings.json

4
apps/vue/src/views/task-management/background-jobs/components/JobTable.vue

@ -72,7 +72,7 @@
{
auth: 'TaskManagement.BackgroundJobs.Pause',
label: L('BackgroundJobs:Pause'),
ifShow: [JobStatus.Running, JobStatus.FailedRetry].includes(record.status),
ifShow: [JobStatus.Queuing, JobStatus.Running, JobStatus.FailedRetry].includes(record.status),
onClick: handlePause.bind(null, record),
},
{
@ -84,7 +84,7 @@
{
auth: 'TaskManagement.BackgroundJobs.Trigger',
label: L('BackgroundJobs:Trigger'),
ifShow: [JobStatus.Running, JobStatus.Completed, JobStatus.FailedRetry].includes(
ifShow: [JobStatus.Queuing, JobStatus.Running, JobStatus.Completed, JobStatus.FailedRetry].includes(
record.status,
),
onClick: handleTrigger.bind(null, record),

6
aspnet-core/modules/lt/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/ILocalizationDbContext.cs

@ -1,4 +1,5 @@
using Volo.Abp.Data;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore
@ -6,5 +7,8 @@ namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore
[ConnectionStringName(LocalizationDbProperties.ConnectionStringName)]
public interface ILocalizationDbContext : IEfCoreDbContext
{
DbSet<Resource> Resources { get; }
DbSet<Language> Languages { get; }
DbSet<Text> Texts { get; }
}
}

11
aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/IMessageServiceDbContext.cs

@ -9,7 +9,14 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore
[ConnectionStringName(AbpMessageServiceDbProperties.ConnectionStringName)]
public interface IMessageServiceDbContext : IEfCoreDbContext
{
DbSet<UserChatCard> UserChatCards { get; set; }
DbSet<UserGroupCard> UserGroupCards { get; set; }
DbSet<UserMessage> UserMessages { get; }
DbSet<GroupMessage> GroupMessages { get; }
DbSet<UserChatFriend> UserChatFriends { get; }
DbSet<UserChatSetting> UserChatSettings { get; }
DbSet<GroupChatBlack> GroupChatBlacks { get; }
DbSet<ChatGroup> ChatGroups { get; }
DbSet<UserChatGroup> UserChatGroups { get; }
DbSet<UserChatCard> UserChatCards { get; }
DbSet<UserGroupCard> UserGroupCards { get; }
}
}

11
aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContext.cs

@ -9,6 +9,13 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore
[ConnectionStringName(AbpMessageServiceDbProperties.ConnectionStringName)]
public class MessageServiceDbContext : AbpDbContext<MessageServiceDbContext>, IMessageServiceDbContext
{
public DbSet<UserMessage> UserMessages { get; set; }
public DbSet<GroupMessage> GroupMessages { get; set; }
public DbSet<UserChatFriend> UserChatFriends { get; set; }
public DbSet<UserChatSetting> UserChatSettings { get; set; }
public DbSet<GroupChatBlack> GroupChatBlacks { get; set; }
public DbSet<ChatGroup> ChatGroups { get; set; }
public DbSet<UserChatGroup> UserChatGroups { get; set; }
public DbSet<UserChatCard> UserChatCards { get; set; }
public DbSet<UserGroupCard> UserGroupCards { get; set; }
@ -18,13 +25,13 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigureMessageService(options =>
{
options.TablePrefix = AbpMessageServiceDbProperties.DefaultTablePrefix;
options.Schema = AbpMessageServiceDbProperties.DefaultSchema;
});
base.OnModelCreating(modelBuilder);
}
}
}

57
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/EfCoreUserNotificationRepository.cs

@ -115,21 +115,29 @@ public class EfCoreUserNotificationRepository : EfCoreRepository<INotificationsD
CancellationToken cancellationToken = default)
{
var dbContext = await GetDbContextAsync();
var userNotifilerQuery = dbContext.Set<UserNotification>()
.Where(x => x.UserId == userId)
.WhereIf(readState.HasValue, x => x.ReadStatus == readState.Value);
var notificationQuery = dbContext.Set<Notification>()
.WhereIf(!filter.IsNullOrWhiteSpace(), nf =>
nf.NotificationName.Contains(filter) ||
nf.NotificationTypeName.Contains(filter));
var notifilerQuery = from un in userNotifilerQuery
join n in notificationQuery
on un.NotificationId equals n.NotificationId
select n;
var notifilerQuery = from un in dbContext.Set<UserNotification>()
join n in dbContext.Set<Notification>()
on un.NotificationId equals n.NotificationId
where un.UserId == userId
select new UserNotificationInfo
{
Id = n.NotificationId,
TenantId = n.TenantId,
Name = n.NotificationName,
ExtraProperties = n.ExtraProperties,
CreationTime = n.CreationTime,
NotificationTypeName = n.NotificationTypeName,
Severity = n.Severity,
State = un.ReadStatus,
Type = n.Type,
ContentType = n.ContentType
};
return await notifilerQuery
.WhereIf(readState.HasValue, x => x.State == readState.Value)
.WhereIf(!filter.IsNullOrWhiteSpace(), nf =>
nf.Name.Contains(filter) ||
nf.NotificationTypeName.Contains(filter))
.CountAsync(GetCancellationToken(cancellationToken));
}
@ -144,18 +152,19 @@ public class EfCoreUserNotificationRepository : EfCoreRepository<INotificationsD
{
sorting ??= $"{nameof(Notification.CreationTime)} DESC";
var dbContext = await GetDbContextAsync();
var userNotifilerQuery = dbContext.Set<UserNotification>()
.Where(x => x.UserId == userId)
.WhereIf(readState.HasValue, x => x.ReadStatus == readState.Value);
//var userNotifilerQuery = dbContext.Set<UserNotification>()
// .Where(x => x.UserId == userId)
// .WhereIf(readState.HasValue, x => x.ReadStatus == readState.Value);
var notificationQuery = dbContext.Set<Notification>()
.WhereIf(!filter.IsNullOrWhiteSpace(), nf =>
nf.NotificationName.Contains(filter) ||
nf.NotificationTypeName.Contains(filter));
//var notificationQuery = dbContext.Set<Notification>()
// .WhereIf(!filter.IsNullOrWhiteSpace(), nf =>
// nf.NotificationName.Contains(filter) ||
// nf.NotificationTypeName.Contains(filter));
var notifilerQuery = from un in userNotifilerQuery
join n in notificationQuery
var notifilerQuery = from un in dbContext.Set<UserNotification>()
join n in dbContext.Set<Notification>()
on un.NotificationId equals n.NotificationId
where un.UserId == userId
select new UserNotificationInfo
{
Id = n.NotificationId,
@ -171,6 +180,10 @@ public class EfCoreUserNotificationRepository : EfCoreRepository<INotificationsD
};
return await notifilerQuery
.WhereIf(readState.HasValue, x => x.State == readState.Value)
.WhereIf(!filter.IsNullOrWhiteSpace(), nf =>
nf.Name.Contains(filter) ||
nf.NotificationTypeName.Contains(filter))
.OrderBy(sorting)
.PageBy(skipCount, maxResultCount)
.AsNoTracking()

9
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/INotificationsDbContext.cs

@ -1,4 +1,5 @@
using Volo.Abp.Data;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.Notifications.EntityFrameworkCore;
@ -6,4 +7,10 @@ namespace LINGYUN.Abp.Notifications.EntityFrameworkCore;
[ConnectionStringName(AbpNotificationsDbProperties.ConnectionStringName)]
public interface INotificationsDbContext : IEfCoreDbContext
{
DbSet<Notification> Notifications { get; }
DbSet<UserNotification> UserNotifications { get; }
DbSet<UserSubscribe> UserSubscribes { get; }
DbSet<NotificationDefinitionGroupRecord> NotificationDefinitionGroupRecords { get; }
DbSet<NotificationDefinitionRecord> NotificationDefinitionRecords { get; }
}

7
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContext.cs

@ -7,6 +7,13 @@ namespace LINGYUN.Abp.Notifications.EntityFrameworkCore;
[ConnectionStringName(AbpNotificationsDbProperties.ConnectionStringName)]
public class NotificationsDbContext : AbpDbContext<NotificationsDbContext>, INotificationsDbContext
{
public DbSet<Notification> Notifications { get; set; }
public DbSet<UserNotification> UserNotifications { get; set; }
public DbSet<UserSubscribe> UserSubscribes { get; set; }
public DbSet<NotificationDefinitionGroupRecord> NotificationDefinitionGroupRecords { get; set; }
public DbSet<NotificationDefinitionRecord> NotificationDefinitionRecords { get; set; }
public NotificationsDbContext(DbContextOptions<NotificationsDbContext> options)
: base(options)
{

13
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/IPlatformDbContext.cs

@ -11,9 +11,14 @@ namespace LINGYUN.Platform.EntityFrameworkCore
[ConnectionStringName(PlatformDbProperties.ConnectionStringName)]
public interface IPlatformDbContext : IEfCoreDbContext
{
DbSet<Menu> Menus { get; set; }
DbSet<Layout> Layouts { get; set; }
DbSet<Data> Datas { get; set; }
DbSet<Package> Packages { get; set; }
DbSet<Menu> Menus { get; }
DbSet<Layout> Layouts { get; }
DbSet<RoleMenu> RoleMenus { get; }
DbSet<UserMenu> UserMenus { get; }
DbSet<UserFavoriteMenu> UserFavoriteMenus { get; }
DbSet<Data> Datas { get; }
DbSet<DataItem> DataItems { get; }
DbSet<Package> Packages { get; }
DbSet<PackageBlob> PackageBlobs { get; }
}
}

14
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContext.cs

@ -11,11 +11,15 @@ namespace LINGYUN.Platform.EntityFrameworkCore
[ConnectionStringName(PlatformDbProperties.ConnectionStringName)]
public class PlatformDbContext : AbpDbContext<PlatformDbContext>, IPlatformDbContext
{
public DbSet<RoleMenu> RoleMenus { get; set; }
public DbSet<UserMenu> UserMenus { get; set; }
public DbSet<UserFavoriteMenu> UserFavoriteMenus { get; set; }
public DbSet<Menu> Menus { get; set; }
public DbSet<Layout> Layouts { get; set; }
public DbSet<Data> Datas { get; set; }
public DbSet<Package> Packages { get; set; }
public DbSet<Data> Datas { get; set; }
public DbSet<DataItem> DataItems { get; set; }
public DbSet<Package> Packages { get; set; }
public DbSet<PackageBlob> PackageBlobs { get; set; }
public PlatformDbContext(DbContextOptions<PlatformDbContext> options)
: base(options)
{
@ -24,9 +28,9 @@ namespace LINGYUN.Platform.EntityFrameworkCore
protected override void OnModelCreating(ModelBuilder builder)
{
builder.ConfigurePlatform();
base.OnModelCreating(builder);
builder.ConfigurePlatform();
}
}
}

5
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/ITaskManagementDbContext.cs

@ -1,4 +1,5 @@
using Volo.Abp.Data;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.TaskManagement.EntityFrameworkCore;
@ -6,4 +7,6 @@ namespace LINGYUN.Abp.TaskManagement.EntityFrameworkCore;
[ConnectionStringName(TaskManagementDbProperties.ConnectionStringName)]
public interface ITaskManagementDbContext :IEfCoreDbContext
{
DbSet<BackgroundJobInfo> BackgroundJobInfos { get; }
DbSet<BackgroundJobAction> BackgroundJobAction { get; }
}

3
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN/Abp/TaskManagement/EntityFrameworkCore/TaskManagementDbContext.cs

@ -7,6 +7,9 @@ namespace LINGYUN.Abp.TaskManagement.EntityFrameworkCore;
[ConnectionStringName(TaskManagementDbProperties.ConnectionStringName)]
public class TaskManagementDbContext : AbpDbContext<TaskManagementDbContext>, ITaskManagementDbContext
{
public DbSet<BackgroundJobInfo> BackgroundJobInfos { get; set; }
public DbSet<BackgroundJobAction> BackgroundJobAction { get; set; }
public TaskManagementDbContext(
DbContextOptions<TaskManagementDbContext> options)
: base(options)

40
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSendRecordAppService.cs

@ -6,6 +6,7 @@ using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.BackgroundJobs;
@ -51,20 +52,35 @@ public class WebhookSendRecordAppService : WebhooksManagementAppServiceBase, IWe
await RecordRepository.DeleteManyAsync(sendRecords);
}
public async virtual Task<PagedResultDto<WebhookSendRecordDto>> GetListAsync(WebhookSendRecordGetListInput input)
private class WebhookSendRecordGetListSpecification : Volo.Abp.Specifications.Specification<WebhookSendRecord>
{
var filter = new WebhookSendRecordFilter
protected WebhookSendRecordGetListInput Filter { get; }
public WebhookSendRecordGetListSpecification(WebhookSendRecordGetListInput filter)
{
Filter = filter;
}
public override Expression<Func<WebhookSendRecord, bool>> ToExpression()
{
TenantId = input.TenantId,
SubscriptionId = input.SubscriptionId,
ResponseStatusCode = input.ResponseStatusCode,
BeginCreationTime = input.BeginCreationTime,
EndCreationTime = input.EndCreationTime,
WebhookEventId = input.WebhookEventId,
Filter = input.Filter
};
var totalCount = await RecordRepository.GetCountAsync(filter);
var sendRecords = await RecordRepository.GetListAsync(filter,
Expression<Func<WebhookSendRecord, bool>> expression = _ => true;
return expression
.AndIf(Filter.TenantId.HasValue, x => x.TenantId == Filter.TenantId)
.AndIf(Filter.WebhookEventId.HasValue, x => x.WebhookEventId == Filter.WebhookEventId)
.AndIf(Filter.SubscriptionId.HasValue, x => x.WebhookSubscriptionId == Filter.SubscriptionId)
.AndIf(Filter.ResponseStatusCode.HasValue, x => x.ResponseStatusCode == Filter.ResponseStatusCode)
.AndIf(Filter.BeginCreationTime.HasValue, x => x.CreationTime.CompareTo(Filter.BeginCreationTime) >= 0)
.AndIf(Filter.EndCreationTime.HasValue, x => x.CreationTime.CompareTo(Filter.EndCreationTime) <= 0)
.AndIf(!Filter.Filter.IsNullOrWhiteSpace(), x => x.Response.Contains(Filter.Filter));
}
}
public async virtual Task<PagedResultDto<WebhookSendRecordDto>> GetListAsync(WebhookSendRecordGetListInput input)
{
var specification = new WebhookSendRecordGetListSpecification(input);
var totalCount = await RecordRepository.GetCountAsync(specification);
var sendRecords = await RecordRepository.GetListAsync(specification,
input.Sorting, input.MaxResultCount, input.SkipCount);
return new PagedResultDto<WebhookSendRecordDto>(totalCount,

32
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/System/Linq/Expressions/ExpressionFuncExtensions.cs

@ -0,0 +1,32 @@
using Volo.Abp.Specifications;
namespace System.Linq.Expressions;
internal static class ExpressionFuncExtensions
{
public static Expression<Func<T, bool>> AndIf<T>(
this Expression<Func<T, bool>> first,
bool condition,
Expression<Func<T, bool>> second)
{
if (condition)
{
return ExpressionFuncExtender.And(first, second);
}
return first;
}
public static Expression<Func<T, bool>> OrIf<T>(
this Expression<Func<T, bool>> first,
bool condition,
Expression<Func<T, bool>> second)
{
if (condition)
{
return ExpressionFuncExtender.Or(first, second);
}
return first;
}
}

7
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookSendRecordRepository.cs

@ -3,18 +3,19 @@ using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Specifications;
namespace LINGYUN.Abp.WebhooksManagement;
public interface IWebhookSendRecordRepository : IRepository<WebhookSendRecord, Guid>
{
Task<int> GetCountAsync(
WebhookSendRecordFilter filter,
ISpecification<WebhookSendRecord> specification,
CancellationToken cancellationToken = default);
Task<List<WebhookSendRecord>> GetListAsync(
WebhookSendRecordFilter filter,
string sorting = nameof(WebhookSendRecord.CreationTime),
ISpecification<WebhookSendRecord> specification,
string sorting = $"{nameof(WebhookSendRecord.CreationTime)} DESC",
int maxResultCount = 10,
int skipCount = 10,
bool includeDetails = false,

28
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/WebhookSendAttemptStore.cs

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Linq.Expressions;
using System.Net;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
@ -14,6 +15,24 @@ namespace LINGYUN.Abp.WebhooksManagement;
public class WebhookSendAttemptStore : DomainService, IWebhookSendAttemptStore
{
private class WebhookSendRecordSpecification : Volo.Abp.Specifications.Specification<WebhookSendRecord>
{
protected Guid SubscriptionId { get; }
public WebhookSendRecordSpecification(
Guid subscriptionId)
{
SubscriptionId = subscriptionId;
}
public override Expression<Func<WebhookSendRecord, bool>> ToExpression()
{
Expression<Func<WebhookSendRecord, bool>> expression = _ => true;
return expression.And(x => x.WebhookSubscriptionId == SubscriptionId);
}
}
protected IObjectMapper<WebhooksManagementDomainModule> ObjectMapper => LazyServiceProvider.LazyGetRequiredService<IObjectMapper<WebhooksManagementDomainModule>>();
protected IWebhookSendRecordRepository WebhookSendAttemptRepository { get; }
@ -33,14 +52,11 @@ public class WebhookSendAttemptStore : DomainService, IWebhookSendAttemptStore
{
using (CurrentTenant.Change(tenantId))
{
var filter = new WebhookSendRecordFilter
{
SubscriptionId = subscriptionId,
};
var totalCount = await WebhookSendAttemptRepository.GetCountAsync(filter);
var specification = new WebhookSendRecordSpecification(subscriptionId);
var totalCount = await WebhookSendAttemptRepository.GetCountAsync(specification);
var list = await WebhookSendAttemptRepository.GetListAsync(
filter,
specification,
maxResultCount: maxResultCount,
skipCount: skipCount);

32
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/System/Linq/Expressions/ExpressionFuncExtensions.cs

@ -0,0 +1,32 @@
using Volo.Abp.Specifications;
namespace System.Linq.Expressions;
internal static class ExpressionFuncExtensions
{
public static Expression<Func<T, bool>> AndIf<T>(
this Expression<Func<T, bool>> first,
bool condition,
Expression<Func<T, bool>> second)
{
if (condition)
{
return ExpressionFuncExtender.And(first, second);
}
return first;
}
public static Expression<Func<T, bool>> OrIf<T>(
this Expression<Func<T, bool>> first,
bool condition,
Expression<Func<T, bool>> second)
{
if (condition)
{
return ExpressionFuncExtender.Or(first, second);
}
return first;
}
}

20
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookSendRecordRepository.cs

@ -7,6 +7,7 @@ using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Specifications;
namespace LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore;
@ -21,24 +22,31 @@ public class EfCoreWebhookSendRecordRepository :
}
public async virtual Task<int> GetCountAsync(
WebhookSendRecordFilter filter,
ISpecification<WebhookSendRecord> specification,
CancellationToken cancellationToken = default)
{
return await ApplyFilter(await GetDbSetAsync(), filter)
return await (await GetDbSetAsync())
.Where(specification.ToExpression())
.CountAsync(GetCancellationToken(cancellationToken));
}
public async virtual Task<List<WebhookSendRecord>> GetListAsync(
WebhookSendRecordFilter filter,
string sorting = "CreationTime",
ISpecification<WebhookSendRecord> specification,
string sorting = $"{nameof(WebhookSendRecord.CreationTime)} DESC",
int maxResultCount = 10,
int skipCount = 10,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
return await ApplyFilter((await GetDbSetAsync()).IncludeDetails(includeDetails), filter)
.OrderBy(sorting ?? $"{nameof(WebhookSendRecord.CreationTime)} DESC")
if (sorting.IsNullOrWhiteSpace())
{
sorting = $"{nameof(WebhookSendRecord.CreationTime)} DESC";
}
return await (await GetDbSetAsync())
.IncludeDetails(includeDetails)
.Where(specification.ToExpression())
.OrderBy(sorting)
.PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken));
}

6
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/IWebhooksManagementDbContext.cs

@ -1,4 +1,5 @@
using Volo.Abp.Data;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.MultiTenancy;
@ -8,4 +9,7 @@ namespace LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore;
[ConnectionStringName(WebhooksManagementDbProperties.ConnectionStringName)]
public interface IWebhooksManagementDbContext : IEfCoreDbContext
{
DbSet<WebhookSendRecord> WebhookSendRecord { get; }
DbSet<WebhookGroupDefinitionRecord> WebhookGroupDefinitionRecords { get; }
DbSet<WebhookDefinitionRecord> WebhookDefinitionRecords { get; }
}

3
aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/WebhooksManagementDbContext.cs

@ -9,6 +9,9 @@ namespace LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore;
[ConnectionStringName(WebhooksManagementDbProperties.ConnectionStringName)]
public class WebhooksManagementDbContext : AbpDbContext<WebhooksManagementDbContext>, IWebhooksManagementDbContext
{
public DbSet<WebhookSendRecord> WebhookSendRecord { get; set; }
public DbSet<WebhookGroupDefinitionRecord> WebhookGroupDefinitionRecords { get; set; }
public DbSet<WebhookDefinitionRecord> WebhookDefinitionRecords { get; set; }
public WebhooksManagementDbContext(
DbContextOptions<WebhooksManagementDbContext> options) : base(options)
{

8
aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs

@ -348,12 +348,16 @@ public partial class MicroServiceApplicationsSingleModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs

@ -278,7 +278,6 @@ public partial class MicroServiceApplicationsSingleModule : AbpModule
ConfigureBlobStoring();
ConfigureLocalization();
ConfigureKestrelServer();
ConfigureJsonSerializer();
ConfigureTextTemplating();
ConfigureBackgroundTasks();
ConfigureFeatureManagement();
@ -290,6 +289,7 @@ public partial class MicroServiceApplicationsSingleModule : AbpModule
ConfigureSwagger(context.Services);
ConfigureEndpoints(context.Services);
ConfigureMultiTenancy(configuration);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration);
ConfigureDistributedLock(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());

7
aspnet-core/services/LY.MicroService.Applications.Single/appsettings.json

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"AllowedHosts": "*",
"Hosting": {
"BasePath": ""

8
aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.Configure.cs

@ -103,12 +103,16 @@ public partial class AuthServerHttpApiHostModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.cs

@ -81,7 +81,6 @@ public partial class AuthServerHttpApiHostModule : AbpModule
ConfigureDbContext();
ConfigureLocalization();
ConfigureJsonSerializer();
ConfigreExceptionHandling();
ConfigureVirtualFileSystem();
ConfigureFeatureManagement();
@ -91,6 +90,7 @@ public partial class AuthServerHttpApiHostModule : AbpModule
ConfigureAuditing(configuration);
ConfigureSwagger(context.Services);
ConfigureMultiTenancy(configuration);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());

7
aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/appsettings.json

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",

8
aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs

@ -183,12 +183,16 @@ public partial class AuthServerModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs

@ -97,7 +97,6 @@ public partial class AuthServerModule : AbpModule
var configuration = context.Services.GetConfiguration();
ConfigureDbContext();
ConfigureJsonSerializer();
ConfigureCaching(configuration);
ConfigureIdentity(configuration);
ConfigureVirtualFileSystem();
@ -107,6 +106,7 @@ public partial class AuthServerModule : AbpModule
ConfigureUrls(configuration);
ConfigureAuditing(configuration);
ConfigureMultiTenancy(configuration);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());

7
aspnet-core/services/LY.MicroService.AuthServer/appsettings.json

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",

8
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.Configure.cs

@ -113,12 +113,16 @@ public partial class BackendAdminHttpApiHostModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.cs

@ -117,7 +117,6 @@ public partial class BackendAdminHttpApiHostModule : AbpModule
ConfigureDbContext();
ConfigureLocalization();
ConfigureJsonSerializer();
ConfigureExceptionHandling();
ConfigureVirtualFileSystem();
ConfigureTextTemplating();
@ -127,6 +126,7 @@ public partial class BackendAdminHttpApiHostModule : AbpModule
ConfigureAuditing(configuration);
ConfigureSwagger(context.Services);
ConfigureMultiTenancy(configuration);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());

7
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/appsettings.json

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"Serilog": {
"MinimumLevel": {
"Default": "Information",

8
aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.Configure.cs

@ -95,12 +95,16 @@ public partial class LocalizationManagementHttpApiHostModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.cs

@ -75,7 +75,6 @@ namespace LY.MicroService.LocalizationManagement
ConfigureDbContext();
ConfigureLocalization();
ConfigureJsonSerializer();
ConfigreExceptionHandling();
ConfigureVirtualFileSystem();
ConfigureFeatureManagement();
@ -83,6 +82,7 @@ namespace LY.MicroService.LocalizationManagement
ConfigureAuditing(configuration);
ConfigureSwagger(context.Services);
ConfigureMultiTenancy(configuration);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());

7
aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/appsettings.json

@ -5,6 +5,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",

8
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.Configure.cs

@ -100,12 +100,16 @@ public partial class PlatformManagementHttpApiHostModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.cs

@ -111,7 +111,6 @@ public partial class PlatformManagementHttpApiHostModule : AbpModule
ConfigureBlobStoring();
ConfigureLocalization();
ConfigureKestrelServer();
ConfigureJsonSerializer();
ConfigreExceptionHandling();
ConfigureVirtualFileSystem();
ConfigureFeatureManagement();
@ -119,6 +118,7 @@ public partial class PlatformManagementHttpApiHostModule : AbpModule
ConfigureAuditing(configuration);
ConfigureSwagger(context.Services);
ConfigureMultiTenancy(configuration);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());

7
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/appsettings.json

@ -5,6 +5,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",

8
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.Configure.cs

@ -147,12 +147,16 @@ public partial class RealtimeMessageHttpApiHostModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs

@ -124,7 +124,6 @@ public partial class RealtimeMessageHttpApiHostModule : AbpModule
ConfigureDbContext();
ConfigureLocalization();
ConfigureNotifications();
ConfigureJsonSerializer();
ConfigureBackgroundTasks();
ConfigreExceptionHandling();
ConfigureVirtualFileSystem();
@ -133,6 +132,7 @@ public partial class RealtimeMessageHttpApiHostModule : AbpModule
ConfigureAuditing(configuration);
ConfigureSwagger(context.Services);
ConfigureMultiTenancy(configuration);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());

7
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.json

@ -5,6 +5,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",

10
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.Configure.cs

@ -144,12 +144,16 @@ public partial class TaskManagementHttpApiHostModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 解决某些不支持类型的序列化
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
// options.DefaultDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.cs

@ -97,7 +97,6 @@ public partial class TaskManagementHttpApiHostModule : AbpModule
ConfigureDbContext();
ConfigureLocalization();
ConfigureJsonSerializer();
ConfigureBackgroundTasks();
ConfigureExceptionHandling();
ConfigureVirtualFileSystem();
@ -106,6 +105,7 @@ public partial class TaskManagementHttpApiHostModule : AbpModule
ConfigureAuditing(configuration);
ConfigureMultiTenancy(configuration);
ConfigureSwagger(context.Services);
ConfigureJsonSerializer(configuration);
ConfigureDistributedLock(context.Services, configuration);
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());
}

12
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/appsettings.json

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"AllowedHosts": "*",
"Serilog": {
"MinimumLevel": {
@ -31,7 +38,6 @@
"path": "Logs/Debug-.log",
"restrictedToMinimumLevel": "Debug",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -41,7 +47,6 @@
"path": "Logs/Info-.log",
"restrictedToMinimumLevel": "Information",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -51,7 +56,6 @@
"path": "Logs/Warn-.log",
"restrictedToMinimumLevel": "Warning",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -61,7 +65,6 @@
"path": "Logs/Error-.log",
"restrictedToMinimumLevel": "Error",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -71,7 +74,6 @@
"path": "Logs/Fatal-.log",
"restrictedToMinimumLevel": "Fatal",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
}

10
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.Configure.cs

@ -151,12 +151,16 @@ public partial class WebhooksManagementHttpApiHostModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 解决某些不支持类型的序列化
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
// options.DefaultDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.cs

@ -98,7 +98,6 @@ public partial class WebhooksManagementHttpApiHostModule : AbpModule
ConfigureWrapper();
ConfigureDbContext();
ConfigureLocalization();
ConfigureJsonSerializer();
ConfigureExceptionHandling();
ConfigureVirtualFileSystem();
ConfigureFeatureManagement();
@ -107,6 +106,7 @@ public partial class WebhooksManagementHttpApiHostModule : AbpModule
ConfigureMultiTenancy(configuration);
ConfigureSwagger(context.Services);
ConfigureWebhooks(context.Services);
ConfigureJsonSerializer(configuration);
ConfigureBackgroundTasks(context.Services);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLock(context.Services, configuration);

12
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/appsettings.json

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"AllowedHosts": "*",
"Serilog": {
"MinimumLevel": {
@ -31,7 +38,6 @@
"path": "Logs/Debug-.log",
"restrictedToMinimumLevel": "Debug",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -41,7 +47,6 @@
"path": "Logs/Info-.log",
"restrictedToMinimumLevel": "Information",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -51,7 +56,6 @@
"path": "Logs/Warn-.log",
"restrictedToMinimumLevel": "Warning",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -61,7 +65,6 @@
"path": "Logs/Error-.log",
"restrictedToMinimumLevel": "Error",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -71,7 +74,6 @@
"path": "Logs/Fatal-.log",
"restrictedToMinimumLevel": "Fatal",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
}

10
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.Configure.cs

@ -234,12 +234,16 @@ public partial class WorkflowManagementHttpApiHostModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 解决某些不支持类型的序列化
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
// options.DefaultDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs

@ -102,7 +102,6 @@ public partial class WorkflowManagementHttpApiHostModule : AbpModule
ConfigureDbContext();
ConfigureLocalization();
ConfigureJsonSerializer();
ConfigureBackgroundTasks();
ConfigureExceptionHandling();
ConfigureVirtualFileSystem();
@ -111,6 +110,7 @@ public partial class WorkflowManagementHttpApiHostModule : AbpModule
ConfigureMultiTenancy(configuration);
ConfigureSwagger(context.Services);
ConfigureEndpoints(context.Services);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration);
ConfigureBlobStoring(context.Services, configuration);
ConfigureDistributedLock(context.Services, configuration);

12
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/appsettings.json

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"AllowedHosts": "*",
"Hosting": {
"BasePath": ""
@ -34,7 +41,6 @@
"path": "Logs/Debug-.log",
"restrictedToMinimumLevel": "Debug",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -44,7 +50,6 @@
"path": "Logs/Info-.log",
"restrictedToMinimumLevel": "Information",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -54,7 +59,6 @@
"path": "Logs/Warn-.log",
"restrictedToMinimumLevel": "Warning",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -64,7 +68,6 @@
"path": "Logs/Error-.log",
"restrictedToMinimumLevel": "Error",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -74,7 +77,6 @@
"path": "Logs/Fatal-.log",
"restrictedToMinimumLevel": "Fatal",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
}

8
aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/IdentityServerHttpApiHostModule.Configure.cs

@ -101,12 +101,16 @@ public partial class IdentityServerHttpApiHostModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/IdentityServerHttpApiHostModule.cs

@ -83,7 +83,6 @@ public partial class IdentityServerHttpApiHostModule : AbpModule
ConfigureDbContext();
ConfigureLocalization();
ConfigureJsonSerializer();
ConfigreExceptionHandling();
ConfigureVirtualFileSystem();
ConfigureFeatureManagement();
@ -93,6 +92,7 @@ public partial class IdentityServerHttpApiHostModule : AbpModule
ConfigureAuditing(configuration);
ConfigureSwagger(context.Services);
ConfigureMultiTenancy(configuration);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());

7
aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/appsettings.json

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",

8
aspnet-core/services/LY.MicroService.identityServer/IdentityServerModule.Configure.cs

@ -133,12 +133,16 @@ public partial class IdentityServerModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/services/LY.MicroService.identityServer/IdentityServerModule.cs

@ -98,7 +98,6 @@ public partial class IdentityServerModule : AbpModule
var configuration = context.Services.GetConfiguration();
ConfigureDbContext();
ConfigureJsonSerializer();
ConfigureCaching(configuration);
ConfigureIdentity(configuration);
ConfigureVirtualFileSystem();
@ -109,6 +108,7 @@ public partial class IdentityServerModule : AbpModule
ConfigureMvcUiTheme();
ConfigureUrls(configuration);
ConfigureMultiTenancy(configuration);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());

7
aspnet-core/services/LY.MicroService.identityServer/appsettings.json

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug",

12
aspnet-core/templates/content/host/PackageName.CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.Configure.cs

@ -106,14 +106,16 @@ public partial class ProjectNameHttpApiHostModule
});
}
private void ConfigureJsonSerializer()
private void ConfigureJsonSerializer(IConfiguration configuration)
{
// 解决某些不支持类型的序列化
// 统一时间日期格式
Configure<AbpJsonOptions>(options =>
{
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss";
options.InputDateTimeFormats.AddIfNotContains("yyyy-MM-dd HH:mm:ss");
options.InputDateTimeFormats.AddIfNotContains("yyyy-MM-ddTHH:mm:ss");
var jsonConfiguration = configuration.GetSection("Json");
if (jsonConfiguration.Exists())
{
jsonConfiguration.Bind(options);
}
});
// 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(options =>

2
aspnet-core/templates/content/host/PackageName.CompanyName.ProjectName.HttpApi.Host/ProjectNameHttpApiHostModule.cs

@ -81,13 +81,13 @@ public partial class ProjectNameHttpApiHostModule : AbpModule
ConfigureWrapper();
ConfigureLocalization();
ConfigureJsonSerializer();
ConfigureExceptionHandling();
ConfigureVirtualFileSystem();
ConfigureCaching(configuration);
ConfigureAuditing(configuration);
ConfigureMultiTenancy(configuration);
ConfigureSwagger(context.Services);
ConfigureJsonSerializer(configuration);
ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLock(context.Services, configuration);
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());

12
aspnet-core/templates/content/host/PackageName.CompanyName.ProjectName.HttpApi.Host/appsettings.json

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#"
},
"Json": {
"OutputDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
"InputDateTimeFormats": [
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-ddTHH:mm:ss"
]
},
"AllowedHosts": "*",
"Serilog": {
"MinimumLevel": {
@ -31,7 +38,6 @@
"path": "Logs/Debug-.log",
"restrictedToMinimumLevel": "Debug",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -41,7 +47,6 @@
"path": "Logs/Info-.log",
"restrictedToMinimumLevel": "Information",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -51,7 +56,6 @@
"path": "Logs/Warn-.log",
"restrictedToMinimumLevel": "Warning",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -61,7 +65,6 @@
"path": "Logs/Error-.log",
"restrictedToMinimumLevel": "Error",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
},
@ -71,7 +74,6 @@
"path": "Logs/Fatal-.log",
"restrictedToMinimumLevel": "Fatal",
"rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
}
}

Loading…
Cancel
Save