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. 10
      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', auth: 'TaskManagement.BackgroundJobs.Pause',
label: L('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), onClick: handlePause.bind(null, record),
}, },
{ {
@ -84,7 +84,7 @@
{ {
auth: 'TaskManagement.BackgroundJobs.Trigger', auth: 'TaskManagement.BackgroundJobs.Trigger',
label: L('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, record.status,
), ),
onClick: handleTrigger.bind(null, record), 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; using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore
@ -6,5 +7,8 @@ namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore
[ConnectionStringName(LocalizationDbProperties.ConnectionStringName)] [ConnectionStringName(LocalizationDbProperties.ConnectionStringName)]
public interface ILocalizationDbContext : IEfCoreDbContext 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)] [ConnectionStringName(AbpMessageServiceDbProperties.ConnectionStringName)]
public interface IMessageServiceDbContext : IEfCoreDbContext public interface IMessageServiceDbContext : IEfCoreDbContext
{ {
DbSet<UserChatCard> UserChatCards { get; set; } DbSet<UserMessage> UserMessages { get; }
DbSet<UserGroupCard> UserGroupCards { get; set; } 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)] [ConnectionStringName(AbpMessageServiceDbProperties.ConnectionStringName)]
public class MessageServiceDbContext : AbpDbContext<MessageServiceDbContext>, IMessageServiceDbContext 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<UserChatCard> UserChatCards { get; set; }
public DbSet<UserGroupCard> UserGroupCards { get; set; } public DbSet<UserGroupCard> UserGroupCards { get; set; }
@ -18,13 +25,13 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore
} }
protected override void OnModelCreating(ModelBuilder modelBuilder) protected override void OnModelCreating(ModelBuilder modelBuilder)
{ {
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigureMessageService(options => modelBuilder.ConfigureMessageService(options =>
{ {
options.TablePrefix = AbpMessageServiceDbProperties.DefaultTablePrefix; options.TablePrefix = AbpMessageServiceDbProperties.DefaultTablePrefix;
options.Schema = AbpMessageServiceDbProperties.DefaultSchema; 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) CancellationToken cancellationToken = default)
{ {
var dbContext = await GetDbContextAsync(); var dbContext = await GetDbContextAsync();
var userNotifilerQuery = dbContext.Set<UserNotification>() var notifilerQuery = from un in dbContext.Set<UserNotification>()
.Where(x => x.UserId == userId) join n in dbContext.Set<Notification>()
.WhereIf(readState.HasValue, x => x.ReadStatus == readState.Value); on un.NotificationId equals n.NotificationId
where un.UserId == userId
var notificationQuery = dbContext.Set<Notification>() select new UserNotificationInfo
.WhereIf(!filter.IsNullOrWhiteSpace(), nf => {
nf.NotificationName.Contains(filter) || Id = n.NotificationId,
nf.NotificationTypeName.Contains(filter)); TenantId = n.TenantId,
Name = n.NotificationName,
var notifilerQuery = from un in userNotifilerQuery ExtraProperties = n.ExtraProperties,
join n in notificationQuery CreationTime = n.CreationTime,
on un.NotificationId equals n.NotificationId NotificationTypeName = n.NotificationTypeName,
select n; Severity = n.Severity,
State = un.ReadStatus,
Type = n.Type,
ContentType = n.ContentType
};
return await notifilerQuery 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)); .CountAsync(GetCancellationToken(cancellationToken));
} }
@ -144,18 +152,19 @@ public class EfCoreUserNotificationRepository : EfCoreRepository<INotificationsD
{ {
sorting ??= $"{nameof(Notification.CreationTime)} DESC"; sorting ??= $"{nameof(Notification.CreationTime)} DESC";
var dbContext = await GetDbContextAsync(); var dbContext = await GetDbContextAsync();
var userNotifilerQuery = dbContext.Set<UserNotification>() //var userNotifilerQuery = dbContext.Set<UserNotification>()
.Where(x => x.UserId == userId) // .Where(x => x.UserId == userId)
.WhereIf(readState.HasValue, x => x.ReadStatus == readState.Value); // .WhereIf(readState.HasValue, x => x.ReadStatus == readState.Value);
var notificationQuery = dbContext.Set<Notification>() //var notificationQuery = dbContext.Set<Notification>()
.WhereIf(!filter.IsNullOrWhiteSpace(), nf => // .WhereIf(!filter.IsNullOrWhiteSpace(), nf =>
nf.NotificationName.Contains(filter) || // nf.NotificationName.Contains(filter) ||
nf.NotificationTypeName.Contains(filter)); // nf.NotificationTypeName.Contains(filter));
var notifilerQuery = from un in userNotifilerQuery var notifilerQuery = from un in dbContext.Set<UserNotification>()
join n in notificationQuery join n in dbContext.Set<Notification>()
on un.NotificationId equals n.NotificationId on un.NotificationId equals n.NotificationId
where un.UserId == userId
select new UserNotificationInfo select new UserNotificationInfo
{ {
Id = n.NotificationId, Id = n.NotificationId,
@ -171,6 +180,10 @@ public class EfCoreUserNotificationRepository : EfCoreRepository<INotificationsD
}; };
return await notifilerQuery 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) .OrderBy(sorting)
.PageBy(skipCount, maxResultCount) .PageBy(skipCount, maxResultCount)
.AsNoTracking() .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; using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.Notifications.EntityFrameworkCore; namespace LINGYUN.Abp.Notifications.EntityFrameworkCore;
@ -6,4 +7,10 @@ namespace LINGYUN.Abp.Notifications.EntityFrameworkCore;
[ConnectionStringName(AbpNotificationsDbProperties.ConnectionStringName)] [ConnectionStringName(AbpNotificationsDbProperties.ConnectionStringName)]
public interface INotificationsDbContext : IEfCoreDbContext 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)] [ConnectionStringName(AbpNotificationsDbProperties.ConnectionStringName)]
public class NotificationsDbContext : AbpDbContext<NotificationsDbContext>, INotificationsDbContext 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) public NotificationsDbContext(DbContextOptions<NotificationsDbContext> options)
: base(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)] [ConnectionStringName(PlatformDbProperties.ConnectionStringName)]
public interface IPlatformDbContext : IEfCoreDbContext public interface IPlatformDbContext : IEfCoreDbContext
{ {
DbSet<Menu> Menus { get; set; } DbSet<Menu> Menus { get; }
DbSet<Layout> Layouts { get; set; } DbSet<Layout> Layouts { get; }
DbSet<Data> Datas { get; set; } DbSet<RoleMenu> RoleMenus { get; }
DbSet<Package> Packages { get; set; } DbSet<UserMenu> UserMenus { get; }
DbSet<UserFavoriteMenu> UserFavoriteMenus { get; }
DbSet<Data> Datas { get; }
DbSet<DataItem> DataItems { get; }
DbSet<Package> Packages { get; }
DbSet<PackageBlob> PackageBlobs { get; }
} }
} }

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

@ -11,11 +11,15 @@ namespace LINGYUN.Platform.EntityFrameworkCore
[ConnectionStringName(PlatformDbProperties.ConnectionStringName)] [ConnectionStringName(PlatformDbProperties.ConnectionStringName)]
public class PlatformDbContext : AbpDbContext<PlatformDbContext>, IPlatformDbContext 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<Menu> Menus { get; set; }
public DbSet<Layout> Layouts { get; set; } public DbSet<Layout> Layouts { get; set; }
public DbSet<Data> Datas { get; set; } public DbSet<Data> Datas { get; set; }
public DbSet<DataItem> DataItems { get; set; }
public DbSet<Package> Packages { get; set; } public DbSet<Package> Packages { get; set; }
public DbSet<PackageBlob> PackageBlobs { get; set; }
public PlatformDbContext(DbContextOptions<PlatformDbContext> options) public PlatformDbContext(DbContextOptions<PlatformDbContext> options)
: base(options) : base(options)
{ {
@ -24,9 +28,9 @@ namespace LINGYUN.Platform.EntityFrameworkCore
protected override void OnModelCreating(ModelBuilder builder) protected override void OnModelCreating(ModelBuilder builder)
{ {
builder.ConfigurePlatform();
base.OnModelCreating(builder); 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; using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Abp.TaskManagement.EntityFrameworkCore; namespace LINGYUN.Abp.TaskManagement.EntityFrameworkCore;
@ -6,4 +7,6 @@ namespace LINGYUN.Abp.TaskManagement.EntityFrameworkCore;
[ConnectionStringName(TaskManagementDbProperties.ConnectionStringName)] [ConnectionStringName(TaskManagementDbProperties.ConnectionStringName)]
public interface ITaskManagementDbContext :IEfCoreDbContext 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)] [ConnectionStringName(TaskManagementDbProperties.ConnectionStringName)]
public class TaskManagementDbContext : AbpDbContext<TaskManagementDbContext>, ITaskManagementDbContext public class TaskManagementDbContext : AbpDbContext<TaskManagementDbContext>, ITaskManagementDbContext
{ {
public DbSet<BackgroundJobInfo> BackgroundJobInfos { get; set; }
public DbSet<BackgroundJobAction> BackgroundJobAction { get; set; }
public TaskManagementDbContext( public TaskManagementDbContext(
DbContextOptions<TaskManagementDbContext> options) DbContextOptions<TaskManagementDbContext> options)
: base(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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.BackgroundJobs; using Volo.Abp.BackgroundJobs;
@ -51,20 +52,35 @@ public class WebhookSendRecordAppService : WebhooksManagementAppServiceBase, IWe
await RecordRepository.DeleteManyAsync(sendRecords); 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, Expression<Func<WebhookSendRecord, bool>> expression = _ => true;
SubscriptionId = input.SubscriptionId,
ResponseStatusCode = input.ResponseStatusCode, return expression
BeginCreationTime = input.BeginCreationTime, .AndIf(Filter.TenantId.HasValue, x => x.TenantId == Filter.TenantId)
EndCreationTime = input.EndCreationTime, .AndIf(Filter.WebhookEventId.HasValue, x => x.WebhookEventId == Filter.WebhookEventId)
WebhookEventId = input.WebhookEventId, .AndIf(Filter.SubscriptionId.HasValue, x => x.WebhookSubscriptionId == Filter.SubscriptionId)
Filter = input.Filter .AndIf(Filter.ResponseStatusCode.HasValue, x => x.ResponseStatusCode == Filter.ResponseStatusCode)
}; .AndIf(Filter.BeginCreationTime.HasValue, x => x.CreationTime.CompareTo(Filter.BeginCreationTime) >= 0)
var totalCount = await RecordRepository.GetCountAsync(filter); .AndIf(Filter.EndCreationTime.HasValue, x => x.CreationTime.CompareTo(Filter.EndCreationTime) <= 0)
var sendRecords = await RecordRepository.GetListAsync(filter, .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); input.Sorting, input.MaxResultCount, input.SkipCount);
return new PagedResultDto<WebhookSendRecordDto>(totalCount, 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;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.Specifications;
namespace LINGYUN.Abp.WebhooksManagement; namespace LINGYUN.Abp.WebhooksManagement;
public interface IWebhookSendRecordRepository : IRepository<WebhookSendRecord, Guid> public interface IWebhookSendRecordRepository : IRepository<WebhookSendRecord, Guid>
{ {
Task<int> GetCountAsync( Task<int> GetCountAsync(
WebhookSendRecordFilter filter, ISpecification<WebhookSendRecord> specification,
CancellationToken cancellationToken = default); CancellationToken cancellationToken = default);
Task<List<WebhookSendRecord>> GetListAsync( Task<List<WebhookSendRecord>> GetListAsync(
WebhookSendRecordFilter filter, ISpecification<WebhookSendRecord> specification,
string sorting = nameof(WebhookSendRecord.CreationTime), string sorting = $"{nameof(WebhookSendRecord.CreationTime)} DESC",
int maxResultCount = 10, int maxResultCount = 10,
int skipCount = 10, int skipCount = 10,
bool includeDetails = false, 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.Generic;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Linq; using System.Linq;
using System.Linq.Expressions;
using System.Net; using System.Net;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
@ -14,6 +15,24 @@ namespace LINGYUN.Abp.WebhooksManagement;
public class WebhookSendAttemptStore : DomainService, IWebhookSendAttemptStore 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 IObjectMapper<WebhooksManagementDomainModule> ObjectMapper => LazyServiceProvider.LazyGetRequiredService<IObjectMapper<WebhooksManagementDomainModule>>();
protected IWebhookSendRecordRepository WebhookSendAttemptRepository { get; } protected IWebhookSendRecordRepository WebhookSendAttemptRepository { get; }
@ -33,14 +52,11 @@ public class WebhookSendAttemptStore : DomainService, IWebhookSendAttemptStore
{ {
using (CurrentTenant.Change(tenantId)) using (CurrentTenant.Change(tenantId))
{ {
var filter = new WebhookSendRecordFilter var specification = new WebhookSendRecordSpecification(subscriptionId);
{ var totalCount = await WebhookSendAttemptRepository.GetCountAsync(specification);
SubscriptionId = subscriptionId,
};
var totalCount = await WebhookSendAttemptRepository.GetCountAsync(filter);
var list = await WebhookSendAttemptRepository.GetListAsync( var list = await WebhookSendAttemptRepository.GetListAsync(
filter, specification,
maxResultCount: maxResultCount, maxResultCount: maxResultCount,
skipCount: skipCount); 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 System.Threading.Tasks;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Specifications;
namespace LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore; namespace LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore;
@ -21,24 +22,31 @@ public class EfCoreWebhookSendRecordRepository :
} }
public async virtual Task<int> GetCountAsync( public async virtual Task<int> GetCountAsync(
WebhookSendRecordFilter filter, ISpecification<WebhookSendRecord> specification,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
return await ApplyFilter(await GetDbSetAsync(), filter) return await (await GetDbSetAsync())
.Where(specification.ToExpression())
.CountAsync(GetCancellationToken(cancellationToken)); .CountAsync(GetCancellationToken(cancellationToken));
} }
public async virtual Task<List<WebhookSendRecord>> GetListAsync( public async virtual Task<List<WebhookSendRecord>> GetListAsync(
WebhookSendRecordFilter filter, ISpecification<WebhookSendRecord> specification,
string sorting = "CreationTime", string sorting = $"{nameof(WebhookSendRecord.CreationTime)} DESC",
int maxResultCount = 10, int maxResultCount = 10,
int skipCount = 10, int skipCount = 10,
bool includeDetails = false, bool includeDetails = false,
CancellationToken cancellationToken = default) CancellationToken cancellationToken = default)
{ {
return await ApplyFilter((await GetDbSetAsync()).IncludeDetails(includeDetails), filter) if (sorting.IsNullOrWhiteSpace())
.OrderBy(sorting ?? $"{nameof(WebhookSendRecord.CreationTime)} DESC") {
sorting = $"{nameof(WebhookSendRecord.CreationTime)} DESC";
}
return await (await GetDbSetAsync())
.IncludeDetails(includeDetails)
.Where(specification.ToExpression())
.OrderBy(sorting)
.PageBy(skipCount, maxResultCount) .PageBy(skipCount, maxResultCount)
.ToListAsync(GetCancellationToken(cancellationToken)); .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.EntityFrameworkCore;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -8,4 +9,7 @@ namespace LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore;
[ConnectionStringName(WebhooksManagementDbProperties.ConnectionStringName)] [ConnectionStringName(WebhooksManagementDbProperties.ConnectionStringName)]
public interface IWebhooksManagementDbContext : IEfCoreDbContext 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)] [ConnectionStringName(WebhooksManagementDbProperties.ConnectionStringName)]
public class WebhooksManagementDbContext : AbpDbContext<WebhooksManagementDbContext>, IWebhooksManagementDbContext 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( public WebhooksManagementDbContext(
DbContextOptions<WebhooksManagementDbContext> options) : base(options) 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 => 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 => Configure<AbpSystemTextJsonSerializerOptions>(options =>

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

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

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

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": "*", "AllowedHosts": "*",
"Hosting": { "Hosting": {
"BasePath": "" "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 => 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 => Configure<AbpSystemTextJsonSerializerOptions>(options =>

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

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

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

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": { "Serilog": {
"MinimumLevel": { "MinimumLevel": {
"Default": "Debug", "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 => 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 => 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(); var configuration = context.Services.GetConfiguration();
ConfigureDbContext(); ConfigureDbContext();
ConfigureJsonSerializer();
ConfigureCaching(configuration); ConfigureCaching(configuration);
ConfigureIdentity(configuration); ConfigureIdentity(configuration);
ConfigureVirtualFileSystem(); ConfigureVirtualFileSystem();
@ -107,6 +106,7 @@ public partial class AuthServerModule : AbpModule
ConfigureUrls(configuration); ConfigureUrls(configuration);
ConfigureAuditing(configuration); ConfigureAuditing(configuration);
ConfigureMultiTenancy(configuration); ConfigureMultiTenancy(configuration);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration); ConfigureCors(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration); ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment()); ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());

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

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": { "Serilog": {
"MinimumLevel": { "MinimumLevel": {
"Default": "Debug", "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 => 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 => Configure<AbpSystemTextJsonSerializerOptions>(options =>

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

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

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

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": { "Serilog": {
"MinimumLevel": { "MinimumLevel": {
"Default": "Information", "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 => 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 => Configure<AbpSystemTextJsonSerializerOptions>(options =>

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

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

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

@ -5,6 +5,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": { "Serilog": {
"MinimumLevel": { "MinimumLevel": {
"Default": "Debug", "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 => 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 => Configure<AbpSystemTextJsonSerializerOptions>(options =>

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

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

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

@ -5,6 +5,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": { "Serilog": {
"MinimumLevel": { "MinimumLevel": {
"Default": "Debug", "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 => 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 => Configure<AbpSystemTextJsonSerializerOptions>(options =>

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

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

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

@ -5,6 +5,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": { "Serilog": {
"MinimumLevel": { "MinimumLevel": {
"Default": "Debug", "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 => 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 => Configure<AbpSystemTextJsonSerializerOptions>(options =>

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

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

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

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": "*", "AllowedHosts": "*",
"Serilog": { "Serilog": {
"MinimumLevel": { "MinimumLevel": {
@ -31,7 +38,6 @@
"path": "Logs/Debug-.log", "path": "Logs/Debug-.log",
"restrictedToMinimumLevel": "Debug", "restrictedToMinimumLevel": "Debug",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Info-.log",
"restrictedToMinimumLevel": "Information", "restrictedToMinimumLevel": "Information",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Warn-.log",
"restrictedToMinimumLevel": "Warning", "restrictedToMinimumLevel": "Warning",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Error-.log",
"restrictedToMinimumLevel": "Error", "restrictedToMinimumLevel": "Error",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Fatal-.log",
"restrictedToMinimumLevel": "Fatal", "restrictedToMinimumLevel": "Fatal",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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 => 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 => Configure<AbpSystemTextJsonSerializerOptions>(options =>

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

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

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

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": "*", "AllowedHosts": "*",
"Serilog": { "Serilog": {
"MinimumLevel": { "MinimumLevel": {
@ -31,7 +38,6 @@
"path": "Logs/Debug-.log", "path": "Logs/Debug-.log",
"restrictedToMinimumLevel": "Debug", "restrictedToMinimumLevel": "Debug",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Info-.log",
"restrictedToMinimumLevel": "Information", "restrictedToMinimumLevel": "Information",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Warn-.log",
"restrictedToMinimumLevel": "Warning", "restrictedToMinimumLevel": "Warning",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Error-.log",
"restrictedToMinimumLevel": "Error", "restrictedToMinimumLevel": "Error",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Fatal-.log",
"restrictedToMinimumLevel": "Fatal", "restrictedToMinimumLevel": "Fatal",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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 => 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 => Configure<AbpSystemTextJsonSerializerOptions>(options =>

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

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

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

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": "*", "AllowedHosts": "*",
"Hosting": { "Hosting": {
"BasePath": "" "BasePath": ""
@ -34,7 +41,6 @@
"path": "Logs/Debug-.log", "path": "Logs/Debug-.log",
"restrictedToMinimumLevel": "Debug", "restrictedToMinimumLevel": "Debug",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Info-.log",
"restrictedToMinimumLevel": "Information", "restrictedToMinimumLevel": "Information",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Warn-.log",
"restrictedToMinimumLevel": "Warning", "restrictedToMinimumLevel": "Warning",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Error-.log",
"restrictedToMinimumLevel": "Error", "restrictedToMinimumLevel": "Error",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Fatal-.log",
"restrictedToMinimumLevel": "Fatal", "restrictedToMinimumLevel": "Fatal",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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 => 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 => Configure<AbpSystemTextJsonSerializerOptions>(options =>

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

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

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

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": { "Serilog": {
"MinimumLevel": { "MinimumLevel": {
"Default": "Debug", "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 => 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 => 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(); var configuration = context.Services.GetConfiguration();
ConfigureDbContext(); ConfigureDbContext();
ConfigureJsonSerializer();
ConfigureCaching(configuration); ConfigureCaching(configuration);
ConfigureIdentity(configuration); ConfigureIdentity(configuration);
ConfigureVirtualFileSystem(); ConfigureVirtualFileSystem();
@ -109,6 +108,7 @@ public partial class IdentityServerModule : AbpModule
ConfigureMvcUiTheme(); ConfigureMvcUiTheme();
ConfigureUrls(configuration); ConfigureUrls(configuration);
ConfigureMultiTenancy(configuration); ConfigureMultiTenancy(configuration);
ConfigureJsonSerializer(configuration);
ConfigureCors(context.Services, configuration); ConfigureCors(context.Services, configuration);
ConfigureDistributedLocking(context.Services, configuration); ConfigureDistributedLocking(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment()); ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());

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

@ -4,6 +4,13 @@
"InitVectorBytes": "s83ng0abvd02js84", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": { "Serilog": {
"MinimumLevel": { "MinimumLevel": {
"Default": "Debug", "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 => Configure<AbpJsonOptions>(options =>
{ {
options.OutputDateTimeFormat = "yyyy-MM-dd HH:mm:ss"; var jsonConfiguration = configuration.GetSection("Json");
options.InputDateTimeFormats.AddIfNotContains("yyyy-MM-dd HH:mm:ss"); if (jsonConfiguration.Exists())
options.InputDateTimeFormats.AddIfNotContains("yyyy-MM-ddTHH:mm:ss"); {
jsonConfiguration.Bind(options);
}
}); });
// 中文序列化的编码问题 // 中文序列化的编码问题
Configure<AbpSystemTextJsonSerializerOptions>(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(); ConfigureWrapper();
ConfigureLocalization(); ConfigureLocalization();
ConfigureJsonSerializer();
ConfigureExceptionHandling(); ConfigureExceptionHandling();
ConfigureVirtualFileSystem(); ConfigureVirtualFileSystem();
ConfigureCaching(configuration); ConfigureCaching(configuration);
ConfigureAuditing(configuration); ConfigureAuditing(configuration);
ConfigureMultiTenancy(configuration); ConfigureMultiTenancy(configuration);
ConfigureSwagger(context.Services); ConfigureSwagger(context.Services);
ConfigureJsonSerializer(configuration);
ConfigureOpenTelemetry(context.Services, configuration); ConfigureOpenTelemetry(context.Services, configuration);
ConfigureDistributedLock(context.Services, configuration); ConfigureDistributedLock(context.Services, configuration);
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment()); 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", "InitVectorBytes": "s83ng0abvd02js84",
"DefaultSalt": "sf&5)s3#" "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": "*", "AllowedHosts": "*",
"Serilog": { "Serilog": {
"MinimumLevel": { "MinimumLevel": {
@ -31,7 +38,6 @@
"path": "Logs/Debug-.log", "path": "Logs/Debug-.log",
"restrictedToMinimumLevel": "Debug", "restrictedToMinimumLevel": "Debug",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Info-.log",
"restrictedToMinimumLevel": "Information", "restrictedToMinimumLevel": "Information",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Warn-.log",
"restrictedToMinimumLevel": "Warning", "restrictedToMinimumLevel": "Warning",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Error-.log",
"restrictedToMinimumLevel": "Error", "restrictedToMinimumLevel": "Error",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "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", "path": "Logs/Fatal-.log",
"restrictedToMinimumLevel": "Fatal", "restrictedToMinimumLevel": "Fatal",
"rollingInterval": "Day", "rollingInterval": "Day",
"fileSizeLimitBytes": 5242880,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}"
} }
} }

Loading…
Cancel
Save