diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/EntityFrameworkCore/RealtimeMessageMigrationsDbContext.cs b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/EntityFrameworkCore/RealtimeMessageMigrationsDbContext.cs index cc6f3ddff..245a8bbb7 100644 --- a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/EntityFrameworkCore/RealtimeMessageMigrationsDbContext.cs +++ b/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 + diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110023420_Initial-Realtime-Message.Designer.cs b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110063428_Initial-Realtime-Message.Designer.cs similarity index 93% rename from aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110023420_Initial-Realtime-Message.Designer.cs rename to aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110063428_Initial-Realtime-Message.Designer.cs index 732f48480..b1ea34d95 100644 --- a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110023420_Initial-Realtime-Message.Designer.cs +++ b/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 { /// @@ -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("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("Id") .ValueGeneratedOnAdd() @@ -589,25 +589,17 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations .HasColumnType("longtext") .HasColumnName("ExtraProperties"); - b.Property("Localization") - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - b.Property("Name") .IsRequired() .HasMaxLength(64) .HasColumnType("varchar(64)"); - b.Property("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("Id") .ValueGeneratedOnAdd() @@ -638,10 +630,6 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations .HasMaxLength(64) .HasColumnType("varchar(64)"); - b.Property("Localization") - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - b.Property("Name") .IsRequired() .HasMaxLength(64) @@ -657,16 +645,12 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations .HasMaxLength(200) .HasColumnType("varchar(200)"); - b.Property("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("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("Id") .ValueGeneratedOnAdd() diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110023420_Initial-Realtime-Message.cs b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110063428_Initial-Realtime-Message.cs similarity index 96% rename from aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110023420_Initial-Realtime-Message.cs rename to aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110063428_Initial-Realtime-Message.cs index 7571152fb..b1ebde592 100644 --- a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/20230110023420_Initial-Realtime-Message.cs +++ b/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(type: "varchar(255)", maxLength: 255, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - ResourceName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Localization = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), AllowSubscriptionToClients = table.Column(type: "tinyint(1)", nullable: false), ExtraProperties = table.Column(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(type: "varchar(255)", maxLength: 255, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - ResourceName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Localization = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), NotificationLifetime = table.Column(type: "int", nullable: false), NotificationType = table.Column(type: "int", nullable: false), ContentType = table.Column(type: "int", nullable: false, defaultValue: 0), diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/RealtimeMessageMigrationsDbContextModelSnapshot.cs b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/RealtimeMessageMigrationsDbContextModelSnapshot.cs index 2c3d93160..b1af499c3 100644 --- a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/Migrations/RealtimeMessageMigrationsDbContextModelSnapshot.cs +++ b/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("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("Id") .ValueGeneratedOnAdd() @@ -586,25 +586,17 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations .HasColumnType("longtext") .HasColumnName("ExtraProperties"); - b.Property("Localization") - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - b.Property("Name") .IsRequired() .HasMaxLength(64) .HasColumnType("varchar(64)"); - b.Property("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("Id") .ValueGeneratedOnAdd() @@ -635,10 +627,6 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations .HasMaxLength(64) .HasColumnType("varchar(64)"); - b.Property("Localization") - .HasMaxLength(128) - .HasColumnType("varchar(128)"); - b.Property("Name") .IsRequired() .HasMaxLength(64) @@ -654,16 +642,12 @@ namespace LY.MicroService.RealtimeMessage.DbMigrator.Migrations .HasMaxLength(200) .HasColumnType("varchar(200)"); - b.Property("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("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("Id") .ValueGeneratedOnAdd() diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/RealtimeMessageDbMigratorModule.cs b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/RealtimeMessageDbMigratorModule.cs index 9aecbb142..8c7f3f5a3 100644 --- a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/RealtimeMessageDbMigratorModule.cs +++ b/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) diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/appsettings.json b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/appsettings.json index e12143b82..60c33068b 100644 --- a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.DbMigrator/appsettings.json +++ b/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", diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/en.json b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/en.json index 42f2f097d..cdd8b18d3 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/en.json +++ b/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", diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/zh-Hans.json b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/zh-Hans.json index 078827ace..eb1ee953d 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/zh-Hans.json +++ b/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": "仪表板", diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/en.json b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/en.json index bd71bebcb..7a13975df 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/en.json +++ b/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", diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json index 069f1bc65..ba4233ca3 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json +++ b/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": "新好友通知", diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs index b7afe06bc..1245784b2 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs @@ -99,9 +99,5 @@ /// 你需要验证问题才能添加好友 /// public const string YouNeedValidationQuestingByAddFriend = Namespace + ":03302"; - /// - /// 通知模板不存在! - /// - public const string NotificationTemplateNotFound = Namespace + ":05404"; } } diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/Localization/DomainShared/en.json b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/Localization/DomainShared/en.json index 153609b48..67c920688 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/Localization/DomainShared/en.json +++ b/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!" } } \ No newline at end of file diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/Localization/DomainShared/zh-Hans.json b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/Localization/DomainShared/zh-Hans.json index 50324cb8c..65283d752 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/Localization/DomainShared/zh-Hans.json +++ b/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": "通知模板不存在!" } } \ No newline at end of file diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecordConsts.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecordConsts.cs index b3e19b50a..c03019a18 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecordConsts.cs +++ b/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; } diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationDefinitionRecordConsts.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationDefinitionRecordConsts.cs index d103ffeae..7d4c3b8d0 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationDefinitionRecordConsts.cs +++ b/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; } diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationsErrorCodes.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationsErrorCodes.cs index 23630baea..852017e6e 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationsErrorCodes.cs +++ b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationsErrorCodes.cs @@ -30,6 +30,6 @@ /// /// 通知模板不存在! /// - public const string NotificationTemplateNotFound = Namespace + ":05404"; + public const string NotificationTemplateNotFound = Namespace + ":01404"; } } diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainModule.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainModule.cs index a44cd376d..b8deb5543 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainModule.cs +++ b/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(options => + Configure(options => { options.SaveStaticNotificationsToDatabase = false; options.IsDynamicNotificationsStoreEnabled = false; @@ -58,7 +58,7 @@ public class AbpNotificationsDomainModule : AbpModule { var options = context .ServiceProvider - .GetRequiredService>() + .GetRequiredService>() .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) { diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsManagementOptions.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsManagementOptions.cs index 7db82663b..bc2c9de77 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsManagementOptions.cs +++ b/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; } } diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionCache.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionCache.cs index b12e23da1..db331e254 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionCache.cs +++ b/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 dynamicNotificationGroupL3Cache, IDistributedCache dynamicNotificationsL3Cache, INotificationDefinitionGroupRecordRepository notificationDefinitionGroupRecordRepository, - INotificationDefinitionRecordRepository notificationDefinitionRecordRepository, - IOptions 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(); - 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(); + 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)); - } } diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionStore.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionStore.cs index fdc3bc190..a270ab465 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/DynamicNotificationDefinitionStore.cs +++ b/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> GetGroupsAsync() { - if (!_notificationsManagementOptions.IsDynamicNotificationStoreEnabled) + if (!_notificationsManagementOptions.IsDynamicNotificationsStoreEnabled) { return Array.Empty(); } @@ -31,7 +31,7 @@ public class DynamicNotificationDefinitionStore : IDynamicNotificationDefinition public async virtual Task> GetNotificationsAsync() { - if (!_notificationsManagementOptions.IsDynamicNotificationStoreEnabled) + if (!_notificationsManagementOptions.IsDynamicNotificationsStoreEnabled) { return Array.Empty(); } @@ -40,7 +40,7 @@ public class DynamicNotificationDefinitionStore : IDynamicNotificationDefinition public async virtual Task GetOrNullAsync(string name) { - if (!_notificationsManagementOptions.IsDynamicNotificationStoreEnabled) + if (!_notificationsManagementOptions.IsDynamicNotificationsStoreEnabled) { return null; } diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecord.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecord.cs index e5241a7b3..21d9293d8 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecord.cs +++ b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionGroupRecord.cs @@ -26,24 +26,6 @@ public class NotificationDefinitionGroupRecord : BasicAggregateRoot, IHasE /// public virtual string Description { get; set; } /// - /// 资源名称 - /// - /// - /// 如果不为空,作为参与本地化资源的名称 - /// DisplayName = L["DisplayName:Localization"] - /// Description = L["Description:Localization"] - /// - public virtual string ResourceName { get; protected set; } - /// - /// 本地化键值名称 - /// - /// - /// 如果不为空,作为参与本地化键值的名称 - /// DisplayName = L["DisplayName:Localization"] - /// Description = L["Description:Localization"] - /// - public virtual string Localization { get; protected set; } - /// /// 允许客户端订阅 /// public virtual bool AllowSubscriptionToClients { get; set; } @@ -60,32 +42,18 @@ public class NotificationDefinitionGroupRecord : BasicAggregateRoot, 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; } - /// - /// 设置本地化资源 - /// - /// - /// - 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) { diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionRecord.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionRecord.cs index d6a0ad633..1498ad208 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionRecord.cs +++ b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionRecord.cs @@ -32,24 +32,6 @@ public class NotificationDefinitionRecord : BasicAggregateRoot, IHasExtraP /// public virtual string Description { get; set; } /// - /// 资源名称 - /// - /// - /// 如果不为空,作为参与本地化资源的名称 - /// DisplayName = L["DisplayName:Localization"] - /// Description = L["Description:Localization"] - /// - public virtual string ResourceName { get; protected set; } - /// - /// 本地化键值名称 - /// - /// - /// 如果不为空,作为参与本地化键值的名称 - /// DisplayName = L["DisplayName:Localization"] - /// Description = L["Description:Localization"] - /// - public virtual string Localization { get; protected set; } - /// /// 存活类型 /// public virtual NotificationLifetime NotificationLifetime { get; set; } @@ -86,8 +68,6 @@ public class NotificationDefinitionRecord : BasicAggregateRoot, 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, IHasExtraP NotificationType = notificationType; ContentType = contentType; - SetLocalization(resourceName, localization); - ExtraProperties = new ExtraPropertyDictionary(); this.SetDefaultsForExtraProperties(); AllowSubscriptionToClients = true; } - /// - /// 设置本地化资源 - /// - /// - /// - 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) { diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionSerializer.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionSerializer.cs index a0cab7267..f64f99ecd 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationDefinitionSerializer.cs +++ b/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 diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationsManagementOptions.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationsManagementOptions.cs deleted file mode 100644 index 2d18a4d7a..000000000 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationsManagementOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace LINGYUN.Abp.Notifications; - -public class NotificationsManagementOptions -{ - /// - /// Default: true. - /// - public bool SaveStaticNotificationsToDatabase { get; set; } = true; - - /// - /// Default: false. - /// - public bool IsDynamicNotificationsStoreEnabled { get; set; } - - public NotificationsManagementOptions() - { - } -} diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsEntityFrameworkCoreModule.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsEntityFrameworkCoreModule.cs index d87f093e3..c9fa4a5f1 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsEntityFrameworkCoreModule.cs +++ b/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(options => { - context.Services.AddAbpDbContext(options => - { - options.AddDefaultRepositories(); + options.AddDefaultRepositories(); - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); - options.AddRepository(); - options.AddRepository(); - }); - } + options.AddRepository(); + options.AddRepository(); + }); } } diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContext.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContext.cs index 5ae9b78a7..65f429e19 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContext.cs +++ b/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; diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs index 9fa15f6c3..8e6db1b92 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs +++ b/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); diff --git a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN/Abp/Notifications/AbpNotificationsHttpApiModule.cs b/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN/Abp/Notifications/AbpNotificationsHttpApiModule.cs index c19e4e64e..f9960f64c 100644 --- a/aspnet-core/modules/notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN/Abp/Notifications/AbpNotificationsHttpApiModule.cs +++ b/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), diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj index ba3e0495d..0e067d558 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj +++ b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj @@ -59,6 +59,9 @@ + + + diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.Configure.cs b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.Configure.cs index f7cdfd09d..d3ae2dacd 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.Configure.cs +++ b/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) diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs index fc5cf0382..c5181b437 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs +++ b/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), diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.Development.json b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.Development.json index 6b89a4d80..273ea5c8e 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.Development.json +++ b/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,