Browse Source

refactor the dynamic notification definition

pull/765/head
cKey 3 years ago
parent
commit
1e5f15e1f7
  1. 2
      aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/EntityFrameworkCore/RealtimeMessageMigrationsDbContext.cs
  2. 1
      aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/LY.MicroService.RealtimeMessage.DbMigrator.csproj
  3. 28
      aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110063428_Initial-Realtime-Message.Designer.cs
  4. 8
      aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110063428_Initial-Realtime-Message.cs
  5. 26
      aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/RealtimeMessageMigrationsDbContextModelSnapshot.cs
  6. 2
      aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/RealtimeMessageDbMigratorModule.cs
  7. 5
      aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/appsettings.json
  8. 1
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/en.json
  9. 1
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/zh-Hans.json
  10. 1
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/en.json
  11. 1
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json
  12. 4
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs
  13. 4
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/Localization/DomainShared/en.json
  14. 4
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/Localization/DomainShared/zh-Hans.json
  15. 2
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecordConsts.cs
  16. 2
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationDefinitionRecordConsts.cs
  17. 2
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationsErrorCodes.cs
  18. 8
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainModule.cs
  19. 6
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsManagementOptions.cs
  20. 84
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionCache.cs
  21. 6
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionStore.cs
  22. 34
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecord.cs
  23. 32
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionRecord.cs
  24. 2
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionSerializer.cs
  25. 18
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationsManagementOptions.cs
  26. 24
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsEntityFrameworkCoreModule.cs
  27. 5
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContext.cs
  28. 8
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs
  29. 2
      aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN/Abp/Notifications/AbpNotificationsHttpApiModule.cs
  30. 3
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj
  31. 2
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.Configure.cs
  32. 20
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs
  33. 23
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.Development.json

2
aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/EntityFrameworkCore/RealtimeMessageMigrationsDbContext.cs

@ -1,4 +1,5 @@
using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using LINGYUN.Abp.Notifications.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
@ -18,6 +19,7 @@ public class RealtimeMessageMigrationsDbContext : AbpDbContext<RealtimeMessageMi
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigureNotifications();
modelBuilder.ConfigureMessageService();
}
}

1
aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/LY.MicroService.RealtimeMessage.DbMigrator.csproj

@ -45,6 +45,7 @@
<ItemGroup>
<ProjectReference Include="..\..\modules\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\modules\message\LINGYUN.Abp.MessageService.EntityFrameworkCore\LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\notifications\LINGYUN.Abp.Notifications.EntityFrameworkCore\LINGYUN.Abp.Notifications.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />
</ItemGroup>

28
aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110023420_Initial-Realtime-Message.Designer.cs → aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110063428_Initial-Realtime-Message.Designer.cs

@ -12,7 +12,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
{
[DbContext(typeof(RealtimeMessageMigrationsDbContext))]
[Migration("20230110023420_Initial-Realtime-Message")]
[Migration("20230110063428_Initial-Realtime-Message")]
partial class InitialRealtimeMessage
{
/// <inheritdoc />
@ -516,7 +516,7 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
b.ToTable("AppUserGroupCards", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b =>
modelBuilder.Entity("LINGYUN.Abp.Notifications.Notification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
@ -568,7 +568,7 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
b.ToTable("AppNotifications", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.NotificationDefinitionGroupRecord", b =>
modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionGroupRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@ -589,25 +589,17 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("Localization")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("ResourceName")
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.HasKey("Id");
b.ToTable("AppNotificationDefinitionGroups", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.NotificationDefinitionRecord", b =>
modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@ -638,10 +630,6 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("Localization")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
@ -657,16 +645,12 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ResourceName")
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.HasKey("Id");
b.ToTable("AppNotificationDefinitions", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b =>
modelBuilder.Entity("LINGYUN.Abp.Notifications.UserNotification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
@ -693,7 +677,7 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
b.ToTable("AppUserNotifications", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b =>
modelBuilder.Entity("LINGYUN.Abp.Notifications.UserSubscribe", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()

8
aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110023420_Initial-Realtime-Message.cs → aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110063428_Initial-Realtime-Message.cs

@ -108,10 +108,6 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ResourceName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Localization = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
AllowSubscriptionToClients = table.Column<bool>(type: "tinyint(1)", nullable: false),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
@ -135,10 +131,6 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ResourceName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Localization = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
NotificationLifetime = table.Column<int>(type: "int", nullable: false),
NotificationType = table.Column<int>(type: "int", nullable: false),
ContentType = table.Column<int>(type: "int", nullable: false, defaultValue: 0),

26
aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/RealtimeMessageMigrationsDbContextModelSnapshot.cs

@ -513,7 +513,7 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
b.ToTable("AppUserGroupCards", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b =>
modelBuilder.Entity("LINGYUN.Abp.Notifications.Notification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
@ -565,7 +565,7 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
b.ToTable("AppNotifications", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.NotificationDefinitionGroupRecord", b =>
modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionGroupRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@ -586,25 +586,17 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("Localization")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("ResourceName")
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.HasKey("Id");
b.ToTable("AppNotificationDefinitionGroups", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.NotificationDefinitionRecord", b =>
modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@ -635,10 +627,6 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("Localization")
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
@ -654,16 +642,12 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ResourceName")
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.HasKey("Id");
b.ToTable("AppNotificationDefinitions", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b =>
modelBuilder.Entity("LINGYUN.Abp.Notifications.UserNotification", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
@ -690,7 +674,7 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations
b.ToTable("AppUserNotifications", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b =>
modelBuilder.Entity("LINGYUN.Abp.Notifications.UserSubscribe", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()

2
aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/RealtimeMessageDbMigratorModule.cs

@ -6,6 +6,7 @@ using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using LINGYUN.Abp.Notifications.EntityFrameworkCore;
namespace LY.MicroService.RealtimeMessage.DbMigrator;
@ -14,6 +15,7 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator;
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpNotificationsEntityFrameworkCoreModule),
typeof(AbpMessageServiceEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
typeof(AbpAutofacModule)

5
aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/appsettings.json

@ -1,7 +1,8 @@
{
"ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AppPlatform": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"Default": "Server=127.0.0.1;Database=Messages-v70;User Id=root;Password=123456",
"Notifications": "Server=127.0.0.1;Database=Messages-v70;User Id=root;Password=123456",
"MessageService": "Server=127.0.0.1;Database=Messages-v70;User Id=root;Password=123456",
"AbpSaas": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",

1
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/en.json

@ -2,7 +2,6 @@
"culture": "en",
"texts": {
"Permission:MessageService": "Message service",
"Permission:Notification": "Notification",
"Permission:Delete": "Delete",
"Permission:Hangfire": "Hangfire",
"Permission:Dashboard": "Dashboard",

1
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/zh-Hans.json

@ -2,7 +2,6 @@
"culture": "zh-Hans",
"texts": {
"Permission:MessageService": "消息服务",
"Permission:Notification": "通知管理",
"Permission:Delete": "删除",
"Permission:Hangfire": "Hangfire",
"Permission:Dashboard": "仪表板",

1
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/en.json

@ -18,7 +18,6 @@
"LINGYUN.Abp.Message:03404": "Sending the message failed: the user does not exist or is deactivated!",
"LINGYUN.Abp.Message:03410": "Users refuse to add friends",
"LINGYUN.Abp.Message:03411": "The other party is already your friend or has sent an authentication request. The operation cannot be repeated!",
"LINGYUN.Abp.Message:05404": "The notification template does not exist!",
"Notifications:IM": "Instant Messaging",
"Notifications:FriendValidation": "Friend verification notification",
"Notifications:NewFriend": "New friend notification",

1
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json

@ -18,7 +18,6 @@
"LINGYUN.Abp.Message:03404": "发送消息失败: 用户不存在或已注销账号!",
"LINGYUN.Abp.Message:03410": "用户拒绝添加好友",
"LINGYUN.Abp.Message:03411": "对方已是您的好友或已发送验证请求,不能重复操作!",
"LINGYUN.Abp.Message:05404": "通知模板不存在!",
"Notifications:IM": "即时通讯",
"Notifications:FriendValidation": "好友验证通知",
"Notifications:NewFriend": "新好友通知",

4
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs

@ -99,9 +99,5 @@
/// 你需要验证问题才能添加好友
/// </summary>
public const string YouNeedValidationQuestingByAddFriend = Namespace + ":03302";
/// <summary>
/// 通知模板不存在!
/// </summary>
public const string NotificationTemplateNotFound = Namespace + ":05404";
}
}

4
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/Localization/DomainShared/en.json

@ -1,6 +1,8 @@
{
"culture": "en",
"texts": {
"Permission:Notification": "Notification",
"Permission:Delete": "Delete",
"LINGYUN.Abp.Notifications:01404": "The notification template does not exist!"
}
}

4
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/Localization/DomainShared/zh-Hans.json

@ -1,6 +1,8 @@
{
"culture": "zh-Hans",
"texts": {
"Permission:Notification": "通知管理",
"Permission:Delete": "删除",
"LINGYUN.Abp.Notifications:01404": "通知模板不存在!"
}
}

2
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecordConsts.cs

@ -4,7 +4,5 @@ public static class NotificationDefinitionGroupRecordConsts
{
public static int MaxNameLength { get; set; } = 64;
public static int MaxDisplayNameLength { get; set; } = 255;
public static int MaxResourceNameLength { get; set; } = 64;
public static int MaxLocalizationLength { get; set; } = 128;
public static int MaxDescriptionLength { get; set; } = 255;
}

2
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationDefinitionRecordConsts.cs

@ -4,8 +4,6 @@ public static class NotificationDefinitionRecordConsts
{
public static int MaxNameLength { get; set; } = 64;
public static int MaxDisplayNameLength { get; set; } = 255;
public static int MaxResourceNameLength { get; set; } = 64;
public static int MaxLocalizationLength { get; set; } = 128;
public static int MaxDescriptionLength { get; set; } = 255;
public static int MaxProvidersLength { get; set; } = 200;
}

2
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationsErrorCodes.cs

@ -30,6 +30,6 @@
/// <summary>
/// 通知模板不存在!
/// </summary>
public const string NotificationTemplateNotFound = Namespace + ":05404";
public const string NotificationTemplateNotFound = Namespace + ":01404";
}
}

8
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainModule.cs

@ -29,7 +29,7 @@ public class AbpNotificationsDomainModule : AbpModule
{
if (context.Services.IsDataMigrationEnvironment())
{
Configure<NotificationsManagementOptions>(options =>
Configure<AbpNotificationsManagementOptions>(options =>
{
options.SaveStaticNotificationsToDatabase = false;
options.IsDynamicNotificationsStoreEnabled = false;
@ -58,7 +58,7 @@ public class AbpNotificationsDomainModule : AbpModule
{
var options = context
.ServiceProvider
.GetRequiredService<IOptions<NotificationsManagementOptions>>()
.GetRequiredService<IOptions<AbpNotificationsManagementOptions>>()
.Value;
if (!options.SaveStaticNotificationsToDatabase && !options.IsDynamicNotificationsStoreEnabled)
@ -100,7 +100,7 @@ public class AbpNotificationsDomainModule : AbpModule
}
private async static Task SaveStaticNotificationsToDatabaseAsync(
NotificationsManagementOptions options,
AbpNotificationsManagementOptions options,
IServiceScope scope,
ICancellationTokenProvider cancellationTokenProvider)
{
@ -134,7 +134,7 @@ public class AbpNotificationsDomainModule : AbpModule
}, cancellationTokenProvider.Token);
}
private async static Task PreCacheDynamicNotificationsAsync(NotificationsManagementOptions options, IServiceScope scope)
private async static Task PreCacheDynamicNotificationsAsync(AbpNotificationsManagementOptions options, IServiceScope scope)
{
if (!options.IsDynamicNotificationsStoreEnabled)
{

6
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsManagementOptions.cs

@ -2,9 +2,11 @@
public class AbpNotificationsManagementOptions
{
public bool IsDynamicNotificationStoreEnabled { get; set; }
public bool SaveStaticNotificationsToDatabase { get; set; }
public bool IsDynamicNotificationsStoreEnabled { get; set; }
public AbpNotificationsManagementOptions()
{
IsDynamicNotificationStoreEnabled = true;
SaveStaticNotificationsToDatabase = true;
IsDynamicNotificationsStoreEnabled = true;
}
}

84
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionCache.cs

@ -1,8 +1,6 @@
using LINGYUN.Abp.Notifications;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@ -32,8 +30,7 @@ public class DynamicNotificationDefinitionCache : IDynamicNotificationDefinition
protected INotificationDefinitionGroupRecordRepository NotificationDefinitionGroupRecordRepository { get; }
protected INotificationDefinitionRecordRepository NotificationDefinitionRecordRepository { get; }
protected AbpLocalizationOptions LocalizationOptions { get; }
protected ILocalizableStringSerializer LocalizableStringSerializer { get; }
protected IStringLocalizerFactory StringLocalizerFactory { get; }
static DynamicNotificationDefinitionCache()
@ -48,8 +45,8 @@ public class DynamicNotificationDefinitionCache : IDynamicNotificationDefinition
IDistributedCache<NotificationDefinitionGroupsCacheItem> dynamicNotificationGroupL3Cache,
IDistributedCache<NotificationDefinitionsCacheItem> dynamicNotificationsL3Cache,
INotificationDefinitionGroupRecordRepository notificationDefinitionGroupRecordRepository,
INotificationDefinitionRecordRepository notificationDefinitionRecordRepository,
IOptions<AbpLocalizationOptions> localizationOptions,
INotificationDefinitionRecordRepository notificationDefinitionRecordRepository,
ILocalizableStringSerializer localizableStringSerializer,
IStringLocalizerFactory stringLocalizerFactory)
{
DynamicNotificationL2Cache = dynamicNotificationL2Cache;
@ -57,7 +54,7 @@ public class DynamicNotificationDefinitionCache : IDynamicNotificationDefinition
DynamicNotificationsL3Cache = dynamicNotificationsL3Cache;
NotificationDefinitionGroupRecordRepository = notificationDefinitionGroupRecordRepository;
NotificationDefinitionRecordRepository = notificationDefinitionRecordRepository;
LocalizationOptions = localizationOptions.Value;
LocalizableStringSerializer = localizableStringSerializer;
StringLocalizerFactory = stringLocalizerFactory;
}
@ -74,7 +71,11 @@ public class DynamicNotificationDefinitionCache : IDynamicNotificationDefinition
foreach (var group in l2GroupCache.Groups)
{
var groupGroup = NotificationGroupDefinition
.Create(group.Name, new FixedLocalizableString(group.DisplayName), group.AllowSubscriptionToClients);
.Create(
group.Name,
LocalizableStringSerializer.Deserialize(group.DisplayName),
group.AllowSubscriptionToClients);
var notificationsInThisGroup = notifications.Notifications
.Where(p => p.GroupName == groupGroup.Name);
@ -82,8 +83,8 @@ public class DynamicNotificationDefinitionCache : IDynamicNotificationDefinition
{
var notificationDefine = groupGroup.AddNotification(
notification.Name,
new FixedLocalizableString(notification.DisplayName),
new FixedLocalizableString(notification.Description),
LocalizableStringSerializer.Deserialize(notification.DisplayName),
LocalizableStringSerializer.Deserialize(notification.Description),
notification.NotificationType,
notification.Lifetime,
notification.ContentType,
@ -114,8 +115,8 @@ public class DynamicNotificationDefinitionCache : IDynamicNotificationDefinition
{
var notificationDefinition = new NotificationDefinition(
notification.Name,
new FixedLocalizableString(notification.DisplayName),
new FixedLocalizableString(notification.Description),
LocalizableStringSerializer.Deserialize(notification.DisplayName),
LocalizableStringSerializer.Deserialize(notification.Description),
notification.NotificationType,
notification.Lifetime,
notification.ContentType,
@ -181,18 +182,19 @@ public class DynamicNotificationDefinitionCache : IDynamicNotificationDefinition
foreach (var record in records)
{
var displayName = record.DisplayName;
var description = record.Description;
if (!displayName.IsNullOrWhiteSpace())
{
displayName = await LocalizableStringSerializer
.Deserialize(displayName)
.LocalizeAsync(StringLocalizerFactory);
}
if (!record.ResourceName.IsNullOrWhiteSpace() && !record.Localization.IsNullOrWhiteSpace())
var description = record.Description;
if (!description.IsNullOrWhiteSpace())
{
var resource = GetResourceOrNull(record.ResourceName);
if (resource != null)
{
var localizer = await StringLocalizerFactory.CreateByResourceNameAsync(resource.ResourceName);
displayName = localizer[$"DisplayName:{record.Localization}"];
description = localizer[$"Description:{record.Localization}"];
}
description = await LocalizableStringSerializer
.Deserialize(description)
.LocalizeAsync(StringLocalizerFactory);
}
recordCaches.Add(new NotificationDefinitionGroupCacheItem(
@ -263,24 +265,26 @@ public class DynamicNotificationDefinitionCache : IDynamicNotificationDefinition
foreach (var record in records)
{
var displayName = record.Name;
var description = record.Name;
var providers = new List<string>();
if (!record.Providers.IsNullOrWhiteSpace())
var displayName = record.DisplayName;
if (!displayName.IsNullOrWhiteSpace())
{
providers = record.Providers.Split(';').ToList();
displayName = await LocalizableStringSerializer
.Deserialize(displayName)
.LocalizeAsync(StringLocalizerFactory);
}
if (record.ResourceName.IsNullOrWhiteSpace() && record.Localization.IsNullOrWhiteSpace())
var description = record.Description;
if (!description.IsNullOrWhiteSpace())
{
description = await LocalizableStringSerializer
.Deserialize(description)
.LocalizeAsync(StringLocalizerFactory);
}
var providers = new List<string>();
if (!record.Providers.IsNullOrWhiteSpace())
{
var resource = GetResourceOrNull(record.ResourceName);
if (resource != null)
{
var localizer = await StringLocalizerFactory.CreateByResourceNameAsync(resource.ResourceName);
displayName = localizer[$"DisplayName:{record.Localization}"];
description = localizer[$"Description:{record.Localization}"];
}
providers = record.Providers.Split(';').ToList();
}
var recordCache = new NotificationDefinitionCacheItem(
@ -319,10 +323,4 @@ public class DynamicNotificationDefinitionCache : IDynamicNotificationDefinition
return records;
}
protected virtual LocalizationResourceBase GetResourceOrNull(string resourceName)
{
return LocalizationOptions.Resources.Values
.FirstOrDefault(x => x.ResourceName.Equals(resourceName));
}
}

6
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionStore.cs

@ -22,7 +22,7 @@ public class DynamicNotificationDefinitionStore : IDynamicNotificationDefinition
public async virtual Task<IReadOnlyList<NotificationGroupDefinition>> GetGroupsAsync()
{
if (!_notificationsManagementOptions.IsDynamicNotificationStoreEnabled)
if (!_notificationsManagementOptions.IsDynamicNotificationsStoreEnabled)
{
return Array.Empty<NotificationGroupDefinition>();
}
@ -31,7 +31,7 @@ public class DynamicNotificationDefinitionStore : IDynamicNotificationDefinition
public async virtual Task<IReadOnlyList<NotificationDefinition>> GetNotificationsAsync()
{
if (!_notificationsManagementOptions.IsDynamicNotificationStoreEnabled)
if (!_notificationsManagementOptions.IsDynamicNotificationsStoreEnabled)
{
return Array.Empty<NotificationDefinition>();
}
@ -40,7 +40,7 @@ public class DynamicNotificationDefinitionStore : IDynamicNotificationDefinition
public async virtual Task<NotificationDefinition> GetOrNullAsync(string name)
{
if (!_notificationsManagementOptions.IsDynamicNotificationStoreEnabled)
if (!_notificationsManagementOptions.IsDynamicNotificationsStoreEnabled)
{
return null;
}

34
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecord.cs

@ -26,24 +26,6 @@ public class NotificationDefinitionGroupRecord : BasicAggregateRoot<Guid>, IHasE
/// </remarks>
public virtual string Description { get; set; }
/// <summary>
/// 资源名称
/// </summary>
/// <remarks>
/// 如果不为空,作为参与本地化资源的名称
/// DisplayName = L["DisplayName:Localization"]
/// Description = L["Description:Localization"]
/// </remarks>
public virtual string ResourceName { get; protected set; }
/// <summary>
/// 本地化键值名称
/// </summary>
/// <remarks>
/// 如果不为空,作为参与本地化键值的名称
/// DisplayName = L["DisplayName:Localization"]
/// Description = L["Description:Localization"]
/// </remarks>
public virtual string Localization { get; protected set; }
/// <summary>
/// 允许客户端订阅
/// </summary>
public virtual bool AllowSubscriptionToClients { get; set; }
@ -60,32 +42,18 @@ public class NotificationDefinitionGroupRecord : BasicAggregateRoot<Guid>, IHasE
Guid id,
string name,
string displayName = null,
string description = null,
string resourceName = null,
string localization = null)
string description = null)
: base(id)
{
Name = Check.NotNullOrWhiteSpace(name, nameof(name), NotificationDefinitionGroupRecordConsts.MaxNameLength);
DisplayName = Check.Length(displayName, nameof(displayName), NotificationDefinitionGroupRecordConsts.MaxDisplayNameLength);
Description = Check.Length(description, nameof(description), NotificationDefinitionGroupRecordConsts.MaxDescriptionLength);
SetLocalization(resourceName, localization);
ExtraProperties = new ExtraPropertyDictionary();
this.SetDefaultsForExtraProperties();
AllowSubscriptionToClients = true;
}
/// <summary>
/// 设置本地化资源
/// </summary>
/// <param name="resourceName"></param>
/// <param name="localization"></param>
public void SetLocalization(string resourceName, string localization)
{
ResourceName = Check.Length(resourceName, nameof(resourceName), NotificationDefinitionGroupRecordConsts.MaxResourceNameLength);
Localization = Check.Length(localization, nameof(localization), NotificationDefinitionGroupRecordConsts.MaxLocalizationLength);
}
public bool HasSameData(NotificationDefinitionGroupRecord otherRecord)
{

32
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionRecord.cs

@ -32,24 +32,6 @@ public class NotificationDefinitionRecord : BasicAggregateRoot<Guid>, IHasExtraP
/// </remarks>
public virtual string Description { get; set; }
/// <summary>
/// 资源名称
/// </summary>
/// <remarks>
/// 如果不为空,作为参与本地化资源的名称
/// DisplayName = L["DisplayName:Localization"]
/// Description = L["Description:Localization"]
/// </remarks>
public virtual string ResourceName { get; protected set; }
/// <summary>
/// 本地化键值名称
/// </summary>
/// <remarks>
/// 如果不为空,作为参与本地化键值的名称
/// DisplayName = L["DisplayName:Localization"]
/// Description = L["Description:Localization"]
/// </remarks>
public virtual string Localization { get; protected set; }
/// <summary>
/// 存活类型
/// </summary>
public virtual NotificationLifetime NotificationLifetime { get; set; }
@ -86,8 +68,6 @@ public class NotificationDefinitionRecord : BasicAggregateRoot<Guid>, IHasExtraP
string groupName,
string displayName = null,
string description = null,
string resourceName = null,
string localization = null,
NotificationLifetime lifetime = NotificationLifetime.Persistent,
NotificationType notificationType = NotificationType.Application,
NotificationContentType contentType = NotificationContentType.Text)
@ -101,23 +81,11 @@ public class NotificationDefinitionRecord : BasicAggregateRoot<Guid>, IHasExtraP
NotificationType = notificationType;
ContentType = contentType;
SetLocalization(resourceName, localization);
ExtraProperties = new ExtraPropertyDictionary();
this.SetDefaultsForExtraProperties();
AllowSubscriptionToClients = true;
}
/// <summary>
/// 设置本地化资源
/// </summary>
/// <param name="resourceName"></param>
/// <param name="localization"></param>
public void SetLocalization(string resourceName, string localization)
{
ResourceName = Check.Length(resourceName, nameof(resourceName), NotificationDefinitionGroupRecordConsts.MaxResourceNameLength);
Localization = Check.Length(localization, nameof(localization), NotificationDefinitionGroupRecordConsts.MaxLocalizationLength);
}
public void UseProviders(params string[] providers)
{

2
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionSerializer.cs

@ -76,8 +76,6 @@ public class NotificationDefinitionSerializer : INotificationDefinitionSerialize
notificationGroup?.Name,
LocalizableStringSerializer.Serialize(notification.DisplayName),
LocalizableStringSerializer.Serialize(notification.Description),
null,
null,
notification.NotificationLifetime,
notification.NotificationType,
notification.ContentType

18
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationsManagementOptions.cs

@ -1,18 +0,0 @@
namespace LINGYUN.Abp.Notifications;
public class NotificationsManagementOptions
{
/// <summary>
/// Default: true.
/// </summary>
public bool SaveStaticNotificationsToDatabase { get; set; } = true;
/// <summary>
/// Default: false.
/// </summary>
public bool IsDynamicNotificationsStoreEnabled { get; set; }
public NotificationsManagementOptions()
{
}
}

24
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsEntityFrameworkCoreModule.cs

@ -13,24 +13,18 @@ namespace LINGYUN.Abp.Notifications.EntityFrameworkCore;
typeof(AbpNotificationsDomainSharedModule))]
public class AbpNotificationsEntityFrameworkCoreModule : AbpModule
{
[DependsOn(
typeof(AbpNotificationsDomainModule),
typeof(AbpEntityFrameworkCoreModule))]
public class AbpMessageServiceEntityFrameworkCoreModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
public override void ConfigureServices(ServiceConfigurationContext context)
context.Services.AddAbpDbContext<NotificationsDbContext>(options =>
{
context.Services.AddAbpDbContext<NotificationsDbContext>(options =>
{
options.AddDefaultRepositories<INotificationsDbContext>();
options.AddDefaultRepositories<INotificationsDbContext>();
options.AddRepository<Notification, EfCoreNotificationRepository>();
options.AddRepository<NotificationDefinitionRecord, EfCoreNotificationDefinitionRecordRepository>();
options.AddRepository<NotificationDefinitionGroupRecord, EfCoreNotificationDefinitionGroupRecordRepository>();
options.AddRepository<Notification, EfCoreNotificationRepository>();
options.AddRepository<NotificationDefinitionRecord, EfCoreNotificationDefinitionRecordRepository>();
options.AddRepository<NotificationDefinitionGroupRecord, EfCoreNotificationDefinitionGroupRecordRepository>();
options.AddRepository<UserNotification, EfCoreUserNotificationRepository>();
options.AddRepository<UserSubscribe, EfCoreUserSubscribeRepository>();
});
}
options.AddRepository<UserNotification, EfCoreUserNotificationRepository>();
options.AddRepository<UserSubscribe, EfCoreUserSubscribeRepository>();
});
}
}

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

@ -1,9 +1,4 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

8
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs

@ -72,10 +72,6 @@ namespace LINGYUN.Abp.Notifications.EntityFrameworkCore
.HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxDisplayNameLength);
b.Property(p => p.Description)
.HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxDescriptionLength);
b.Property(p => p.ResourceName)
.HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxResourceNameLength);
b.Property(p => p.Localization)
.HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxLocalizationLength);
b.ConfigureByConvention();
});
@ -95,10 +91,6 @@ namespace LINGYUN.Abp.Notifications.EntityFrameworkCore
.HasMaxLength(NotificationDefinitionRecordConsts.MaxDisplayNameLength);
b.Property(p => p.Description)
.HasMaxLength(NotificationDefinitionRecordConsts.MaxDescriptionLength);
b.Property(p => p.ResourceName)
.HasMaxLength(NotificationDefinitionRecordConsts.MaxResourceNameLength);
b.Property(p => p.Localization)
.HasMaxLength(NotificationDefinitionRecordConsts.MaxLocalizationLength);
b.Property(p => p.Providers)
.HasMaxLength(NotificationDefinitionRecordConsts.MaxProvidersLength);

2
aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN/Abp/Notifications/AbpNotificationsHttpApiModule.cs

@ -4,7 +4,7 @@ using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Notifications.HttpApi;
namespace LINGYUN.Abp.Notifications;
[DependsOn(
typeof(AbpAspNetCoreMvcModule),

3
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj

@ -59,6 +59,9 @@
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.EntityFrameworkCore\LINGYUN.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.AspNetCore.Mvc.Localization\LINGYUN.Abp.AspNetCore.Mvc.Localization.csproj" />
<ProjectReference Include="..\..\modules\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\modules\notifications\LINGYUN.Abp.Notifications.Application\LINGYUN.Abp.Notifications.Application.csproj" />
<ProjectReference Include="..\..\modules\notifications\LINGYUN.Abp.Notifications.EntityFrameworkCore\LINGYUN.Abp.Notifications.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\notifications\LINGYUN.Abp.Notifications.HttpApi\LINGYUN.Abp.Notifications.HttpApi.csproj" />
<ProjectReference Include="..\..\modules\pushplus\LINGYUN.Abp.Notifications.PushPlus\LINGYUN.Abp.Notifications.PushPlus.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.Quartz\LINGYUN.Abp.BackgroundTasks.Quartz.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.DistributedLocking\LINGYUN.Abp.BackgroundTasks.DistributedLocking.csproj" />

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

@ -348,7 +348,7 @@ public partial class RealtimeMessageHttpApiHostModule
if (isDevelopment)
{
// services.AddAlwaysAllowAuthorization();
services.AddAlwaysAllowAuthorization();
}
if (!isDevelopment)

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

@ -1,14 +1,15 @@
using DotNetCore.CAP;
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.AspNetCore.Mvc.Localization;
using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authorization.OrganizationUnits;
using LINGYUN.Abp.BackgroundTasks.ExceptionHandling;
using LINGYUN.Abp.BackgroundTasks.DistributedLocking;
using LINGYUN.Abp.BackgroundTasks.ExceptionHandling;
using LINGYUN.Abp.BackgroundTasks.Quartz;
using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.ExceptionHandling.Notifications;
using LINGYUN.Abp.Http.Client.Wrapper;
using LINGYUN.Abp.Identity.EntityFrameworkCore;
using LINGYUN.Abp.Identity.WeChat;
using LINGYUN.Abp.IM.SignalR;
@ -16,12 +17,16 @@ using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.MessageService;
using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using LINGYUN.Abp.Notifications;
using LINGYUN.Abp.Notifications.Common;
using LINGYUN.Abp.Notifications.Emailing;
using LINGYUN.Abp.Notifications.EntityFrameworkCore;
using LINGYUN.Abp.Notifications.Jobs;
using LINGYUN.Abp.Notifications.PushPlus;
using LINGYUN.Abp.Notifications.SignalR;
using LINGYUN.Abp.Notifications.Sms;
using LINGYUN.Abp.Notifications.WeChat.MiniProgram;
using LINGYUN.Abp.Notifications.WxPusher;
using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
@ -38,15 +43,11 @@ using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.Modularity;
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.TextTemplating.Scriban;
using LINGYUN.Abp.Notifications.PushPlus;
using LINGYUN.Abp.Notifications.WxPusher;
using LINGYUN.Abp.Http.Client.Wrapper;
using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
namespace LY.MicroService.RealtimeMessage;
@ -59,12 +60,15 @@ namespace LY.MicroService.RealtimeMessage;
typeof(AbpAspNetCoreMvcLocalizationModule),
typeof(AbpMessageServiceApplicationModule),
typeof(AbpMessageServiceHttpApiModule),
typeof(AbpNotificationsApplicationModule),
typeof(AbpNotificationsHttpApiModule),
typeof(AbpIdentityWeChatModule),
typeof(AbpBackgroundTasksQuartzModule),
typeof(AbpBackgroundTasksDistributedLockingModule),
typeof(AbpBackgroundTasksExceptionHandlingModule),
typeof(TaskManagementEntityFrameworkCoreModule),
typeof(AbpMessageServiceEntityFrameworkCoreModule),
typeof(AbpNotificationsEntityFrameworkCoreModule),
typeof(AbpSaasEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),

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

@ -1,6 +1,6 @@
{
"AgileConfig": {
"IsEnabled": true,
"IsEnabled": false,
"env": "DEV",
"appId": "LINGYUN.Abp.Message",
"secret": "1q2w3E*",
@ -35,16 +35,17 @@
}
},
"ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=Messages;User Id=root;Password=123456",
"MessageService": "Server=127.0.0.1;Database=Messages;User Id=root;Password=123456",
"TaskManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpIdentity": "Server=127.0.0.1;Database=IdentityServer;User Id=root;Password=123456",
"AbpSaas": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpTextTemplating": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456"
"Default": "Server=127.0.0.1;Database=Messages-v70;User Id=root;Password=123456",
"MessageService": "Server=127.0.0.1;Database=Messages-v70;User Id=root;Password=123456",
"Notifications": "Server=127.0.0.1;Database=Messages-v70;User Id=root;Password=123456",
"TaskManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpIdentity": "Server=127.0.0.1;Database=IdentityServer-v70;User Id=root;Password=123456",
"AbpSaas": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpTextTemplating": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456"
},
"Redis": {
"IsEnabled": true,

Loading…
Cancel
Save