From 8a49331b43673731054ff2c5aebac215e30c3d8d Mon Sep 17 00:00:00 2001
From: cKey <35512826+colinin@users.noreply.github.com>
Date: Tue, 2 Jun 2020 22:15:16 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84IM=E9=A1=B9=E7=9B=AE;?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B=E4=B8=8D=E5=90=88=E7=90=86?=
=?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.en.md | 14 +-
README.md | 14 +-
...34027_Add-Chat-Message-Entites.Designer.cs | 494 ++++++++++++++++++
...20200602134027_Add-Chat-Message-Entites.cs | 281 ++++++++++
...iceHostMigrationsDbContextModelSnapshot.cs | 368 ++++++++++++-
.../LINGYUN/Abp/IM/SignalR/Hubs/MessageHub.cs | 10 +-
.../SignalR/Messages/SignalRMessageSender.cs | 72 +--
.../LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj | 2 +-
.../LINGYUN/Abp/IM/Group/Group.cs | 26 +
.../LINGYUN/Abp/IM/Group/GroupChat.cs | 8 -
.../LINGYUN/Abp/IM/Group/IUserGroupStore.cs | 4 +-
.../LINGYUN/Abp/IM/Group/UserGroup.cs | 2 +
.../LINGYUN/Abp/IM/Messages/ChatMessage.cs | 18 +-
.../LINGYUN/Abp/IM/Messages/IMessageStore.cs | 5 +-
.../Abp/IM/Messages/MessageSendState.cs} | 4 +-
.../Abp/Notifications/NotificationInfo.cs | 2 +
.../Localization/Resources/en.json | 3 +-
.../Localization/Resources/zh-Hans.json | 3 +-
.../Clients/ClientAppService.cs | 9 +-
.../MessageServiceErrorCodes.cs | 30 ++
.../Messages/ChatGroupConsts.cs | 15 +
.../MessageService/Messages/MessageConsts.cs | 10 +
.../Notifications/NotificationConsts.cs | 0
.../Subscriptions/SubscribeConsts.cs | 0
.../LINGYUN.Abp.MessageService.Domain.csproj | 11 +
.../EventBus/UserCreateEventHandler.cs | 48 ++
.../Localization/Resources/en.json | 11 +
.../Localization/Resources/zh-Hans.json | 11 +
.../MessageServiceDomainAutoMapperProfile.cs | 26 +-
.../Abp/MessageService/Messages/ChatGroup.cs | 76 +++
.../MessageService/Messages/ChatGroupAdmin.cs | 69 +++
.../MessageService/Messages/ChatMessage.cs | 30 --
.../MessageService/Messages/GroupChatBlack.cs | 32 ++
.../MessageService/Messages/GroupMessage.cs | 24 +
.../Messages/IGroupRepository.cs | 22 +
.../Messages/IMessageRepository.cs | 24 +
.../Messages/IUserChatGroupRepository.cs | 25 +
.../Messages/IUserChatSettingRepository.cs | 20 +
.../Abp/MessageService/Messages/Message.cs | 50 ++
.../MessageService/Messages/MessageStore.cs | 132 +++++
.../MessageService/Messages/UserChatBlack.cs | 32 ++
.../MessageService/Messages/UserChatGroup.cs | 27 +
.../Messages/UserChatSetting.cs | 54 ++
.../MessageService/Messages/UserGroupStore.cs | 86 +++
.../MessageService/Messages/UserMessage.cs | 25 +
.../Messages/UserSpecialFocus.cs | 32 ++
...MessageServiceEntityFrameworkCoreModule.cs | 7 +-
...ServiceDbContextModelCreatingExtensions.cs | 102 +++-
.../Messages/EfCoreGroupRepository.cs | 43 ++
.../Messages/EfCoreMessageRepository.cs | 114 ++++
.../Messages/EfCoreUserChatGroupRepository.cs | 86 +++
.../EfCoreUserChatSettingRepository.cs | 39 ++
.../SettingManagement/SettingAppService.cs | 6 +
vueJs/images/aggregate.png | Bin 0 -> 47986 bytes
vueJs/images/client.png | Bin 0 -> 52915 bytes
vueJs/images/im-notifications.png | Bin 0 -> 63710 bytes
vueJs/images/tenant.png | Bin 0 -> 34253 bytes
vueJs/src/components/TenantBox/index.vue | 3 +-
58 files changed, 2558 insertions(+), 103 deletions(-)
create mode 100644 aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.Designer.cs
create mode 100644 aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.cs
create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Group/Group.cs
delete mode 100644 aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Group/GroupChat.cs
rename aspnet-core/modules/{message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/SendStatus.cs => common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSendState.cs} (84%)
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Messages/ChatGroupConsts.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Messages/MessageConsts.cs
rename aspnet-core/modules/message/{LINGYUN.Abp.MessageService.Domain => LINGYUN.Abp.MessageService.Domain.Shared}/LINGYUN/Abp/MessageService/Notifications/NotificationConsts.cs (100%)
rename aspnet-core/modules/message/{LINGYUN.Abp.MessageService.Domain => LINGYUN.Abp.MessageService.Domain.Shared}/LINGYUN/Abp/MessageService/Subscriptions/SubscribeConsts.cs (100%)
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/UserCreateEventHandler.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Localization/Resources/en.json
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/ChatGroup.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/ChatGroupAdmin.cs
delete mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/ChatMessage.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/GroupChatBlack.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/GroupMessage.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/IGroupRepository.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/IMessageRepository.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/IUserChatGroupRepository.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/IUserChatSettingRepository.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/Message.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/MessageStore.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/UserChatBlack.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/UserChatGroup.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/UserChatSetting.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/UserGroupStore.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/UserMessage.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Messages/UserSpecialFocus.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Messages/EfCoreGroupRepository.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Messages/EfCoreMessageRepository.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Messages/EfCoreUserChatGroupRepository.cs
create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Messages/EfCoreUserChatSettingRepository.cs
create mode 100644 vueJs/images/aggregate.png
create mode 100644 vueJs/images/client.png
create mode 100644 vueJs/images/im-notifications.png
create mode 100644 vueJs/images/tenant.png
diff --git a/README.en.md b/README.en.md
index 85dd66395..f4edfe568 100644
--- a/README.en.md
+++ b/README.en.md
@@ -41,7 +41,19 @@ If you want to get started with a minimal template code instead of integration s
## Screenshots
-
+
+
+
+
+
+
+
+
+
+
+
+
+
## Related Projects
diff --git a/README.md b/README.md
index f5b5cd661..7c4f53eac 100644
--- a/README.md
+++ b/README.md
@@ -19,11 +19,19 @@
## 截图
-
+
-
+
-
+
+
+
+
+
+
+
+
+
## 相关项目
diff --git a/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.Designer.cs b/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.Designer.cs
new file mode 100644
index 000000000..6b90f18d7
--- /dev/null
+++ b/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.Designer.cs
@@ -0,0 +1,494 @@
+//
+using System;
+using LINGYUN.Abp.MessageService.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+namespace LINGYUN.Abp.MessageService.Migrations
+{
+ [DbContext(typeof(MessageServiceHostMigrationsDbContext))]
+ [Migration("20200602134027_Add-Chat-Message-Entites")]
+ partial class AddChatMessageEntites
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "3.1.3")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.ChatGroup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("Address")
+ .HasColumnType("varchar(256) CHARACTER SET utf8mb4")
+ .HasMaxLength(256);
+
+ b.Property("AllowAnonymous")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowSendMessage")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("Description")
+ .HasColumnType("varchar(128) CHARACTER SET utf8mb4")
+ .HasMaxLength(128);
+
+ b.Property("GroupId")
+ .HasColumnType("bigint");
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId")
+ .HasColumnType("char(36)");
+
+ b.Property("MaxUserCount")
+ .HasColumnType("int");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(20) CHARACTER SET utf8mb4")
+ .HasMaxLength(20);
+
+ b.Property("Notice")
+ .HasColumnType("varchar(64) CHARACTER SET utf8mb4")
+ .HasMaxLength(64);
+
+ b.Property("Tag")
+ .HasColumnType("varchar(512) CHARACTER SET utf8mb4")
+ .HasMaxLength(512);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "Name");
+
+ b.ToTable("AppChatGroups");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.ChatGroupAdmin", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("AllowAddPeople")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowDissolveGroup")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowKickPeople")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowSendNotice")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowSilence")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("GroupId")
+ .HasColumnType("bigint");
+
+ b.Property("IsSuperAdmin")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "GroupId");
+
+ b.ToTable("AppChatGroupAdmins");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.GroupChatBlack", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("GroupId")
+ .HasColumnType("bigint");
+
+ b.Property("ShieldUserId")
+ .HasColumnType("char(36)");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "GroupId");
+
+ b.ToTable("AppGroupChatBlacks");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.GroupMessage", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("longtext CHARACTER SET utf8mb4")
+ .HasMaxLength(1048576);
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("GroupId")
+ .HasColumnType("bigint");
+
+ b.Property("MessageId")
+ .HasColumnType("bigint");
+
+ b.Property("SendState")
+ .HasColumnType("tinyint");
+
+ b.Property("SendUserName")
+ .IsRequired()
+ .HasColumnType("varchar(64) CHARACTER SET utf8mb4")
+ .HasMaxLength(64);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("Type")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "GroupId");
+
+ b.ToTable("AppGroupMessages");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatBlack", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("ShieldUserId")
+ .HasColumnType("char(36)");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "UserId");
+
+ b.ToTable("AppUserChatBlacks");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatGroup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("GroupId")
+ .HasColumnType("bigint");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "GroupId", "UserId");
+
+ b.ToTable("AppUserChatGroups");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatSetting", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("AllowAddFriend")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowAnonymous")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowReceiveMessage")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowSendMessage")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("RequireAddFriendValition")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "UserId");
+
+ b.ToTable("AppUserChatSettings");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserMessage", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("longtext CHARACTER SET utf8mb4")
+ .HasMaxLength(1048576);
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("MessageId")
+ .HasColumnType("bigint");
+
+ b.Property("ReceiveUserId")
+ .HasColumnType("char(36)");
+
+ b.Property("SendState")
+ .HasColumnType("tinyint");
+
+ b.Property("SendUserName")
+ .IsRequired()
+ .HasColumnType("varchar(64) CHARACTER SET utf8mb4")
+ .HasMaxLength(64);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("Type")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "ReceiveUserId");
+
+ b.ToTable("AppUserMessages");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserSpecialFocus", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("FocusUserId")
+ .HasColumnType("char(36)");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "UserId");
+
+ b.ToTable("AppUserSpecialFocuss");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ExpirationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("NotificationData")
+ .IsRequired()
+ .HasColumnType("longtext CHARACTER SET utf8mb4")
+ .HasMaxLength(1048576);
+
+ b.Property("NotificationId")
+ .HasColumnType("bigint");
+
+ b.Property("NotificationName")
+ .IsRequired()
+ .HasColumnType("varchar(100) CHARACTER SET utf8mb4")
+ .HasMaxLength(100);
+
+ b.Property("NotificationTypeName")
+ .IsRequired()
+ .HasColumnType("varchar(512) CHARACTER SET utf8mb4")
+ .HasMaxLength(512);
+
+ b.Property("Severity")
+ .HasColumnType("tinyint");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("Type")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NotificationName");
+
+ b.ToTable("AppNotifications");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("NotificationId")
+ .HasColumnType("bigint");
+
+ b.Property("ReadStatus")
+ .HasColumnType("int");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "UserId", "NotificationId")
+ .HasName("IX_Tenant_User_Notification_Id");
+
+ b.ToTable("AppUserNotifications");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("NotificationName")
+ .IsRequired()
+ .HasColumnType("varchar(100) CHARACTER SET utf8mb4")
+ .HasMaxLength(100);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "UserId", "NotificationName")
+ .IsUnique()
+ .HasName("IX_Tenant_User_Notification_Name");
+
+ b.ToTable("AppUserSubscribes");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.cs b/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.cs
new file mode 100644
index 000000000..c11cb75b4
--- /dev/null
+++ b/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20200602134027_Add-Chat-Message-Entites.cs
@@ -0,0 +1,281 @@
+using System;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace LINGYUN.Abp.MessageService.Migrations
+{
+ public partial class AddChatMessageEntites : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn(
+ name: "ReadStatus",
+ table: "AppUserNotifications",
+ nullable: false,
+ oldClrType: typeof(sbyte),
+ oldType: "tinyint");
+
+ migrationBuilder.CreateTable(
+ name: "AppChatGroupAdmins",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ LastModificationTime = table.Column(nullable: true),
+ LastModifierId = table.Column(nullable: true),
+ TenantId = table.Column(nullable: true),
+ GroupId = table.Column(nullable: false),
+ UserId = table.Column(nullable: false),
+ IsSuperAdmin = table.Column(nullable: false),
+ AllowSilence = table.Column(nullable: false),
+ AllowKickPeople = table.Column(nullable: false),
+ AllowAddPeople = table.Column(nullable: false),
+ AllowSendNotice = table.Column(nullable: false),
+ AllowDissolveGroup = table.Column(nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppChatGroupAdmins", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppChatGroups",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ LastModificationTime = table.Column(nullable: true),
+ LastModifierId = table.Column(nullable: true),
+ TenantId = table.Column(nullable: true),
+ GroupId = table.Column(nullable: false),
+ Name = table.Column(maxLength: 20, nullable: false),
+ Tag = table.Column(maxLength: 512, nullable: true),
+ Address = table.Column(maxLength: 256, nullable: true),
+ Notice = table.Column(maxLength: 64, nullable: true),
+ MaxUserCount = table.Column(nullable: false),
+ AllowAnonymous = table.Column(nullable: false),
+ AllowSendMessage = table.Column(nullable: false),
+ Description = table.Column(maxLength: 128, nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppChatGroups", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppGroupChatBlacks",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ TenantId = table.Column(nullable: true),
+ GroupId = table.Column(nullable: false),
+ ShieldUserId = table.Column(nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppGroupChatBlacks", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppGroupMessages",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ TenantId = table.Column(nullable: true),
+ MessageId = table.Column(nullable: false),
+ SendUserName = table.Column(maxLength: 64, nullable: false),
+ Content = table.Column(maxLength: 1048576, nullable: false),
+ Type = table.Column(nullable: false),
+ SendState = table.Column(nullable: false),
+ GroupId = table.Column(nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppGroupMessages", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppUserChatBlacks",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ TenantId = table.Column(nullable: true),
+ UserId = table.Column(nullable: false),
+ ShieldUserId = table.Column(nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppUserChatBlacks", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppUserChatGroups",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ TenantId = table.Column(nullable: true),
+ UserId = table.Column(nullable: false),
+ GroupId = table.Column(nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppUserChatGroups", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppUserChatSettings",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ TenantId = table.Column(nullable: true),
+ UserId = table.Column(nullable: false),
+ AllowAnonymous = table.Column(nullable: false),
+ AllowAddFriend = table.Column(nullable: false),
+ RequireAddFriendValition = table.Column(nullable: false),
+ AllowReceiveMessage = table.Column(nullable: false),
+ AllowSendMessage = table.Column(nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppUserChatSettings", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppUserMessages",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ TenantId = table.Column(nullable: true),
+ MessageId = table.Column(nullable: false),
+ SendUserName = table.Column(maxLength: 64, nullable: false),
+ Content = table.Column(maxLength: 1048576, nullable: false),
+ Type = table.Column(nullable: false),
+ SendState = table.Column(nullable: false),
+ ReceiveUserId = table.Column(nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppUserMessages", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AppUserSpecialFocuss",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ TenantId = table.Column(nullable: true),
+ UserId = table.Column(nullable: false),
+ FocusUserId = table.Column(nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppUserSpecialFocuss", x => x.Id);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppChatGroupAdmins_TenantId_GroupId",
+ table: "AppChatGroupAdmins",
+ columns: new[] { "TenantId", "GroupId" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppChatGroups_TenantId_Name",
+ table: "AppChatGroups",
+ columns: new[] { "TenantId", "Name" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppGroupChatBlacks_TenantId_GroupId",
+ table: "AppGroupChatBlacks",
+ columns: new[] { "TenantId", "GroupId" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppGroupMessages_TenantId_GroupId",
+ table: "AppGroupMessages",
+ columns: new[] { "TenantId", "GroupId" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppUserChatBlacks_TenantId_UserId",
+ table: "AppUserChatBlacks",
+ columns: new[] { "TenantId", "UserId" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppUserChatGroups_TenantId_GroupId_UserId",
+ table: "AppUserChatGroups",
+ columns: new[] { "TenantId", "GroupId", "UserId" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppUserChatSettings_TenantId_UserId",
+ table: "AppUserChatSettings",
+ columns: new[] { "TenantId", "UserId" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppUserMessages_TenantId_ReceiveUserId",
+ table: "AppUserMessages",
+ columns: new[] { "TenantId", "ReceiveUserId" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AppUserSpecialFocuss_TenantId_UserId",
+ table: "AppUserSpecialFocuss",
+ columns: new[] { "TenantId", "UserId" });
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "AppChatGroupAdmins");
+
+ migrationBuilder.DropTable(
+ name: "AppChatGroups");
+
+ migrationBuilder.DropTable(
+ name: "AppGroupChatBlacks");
+
+ migrationBuilder.DropTable(
+ name: "AppGroupMessages");
+
+ migrationBuilder.DropTable(
+ name: "AppUserChatBlacks");
+
+ migrationBuilder.DropTable(
+ name: "AppUserChatGroups");
+
+ migrationBuilder.DropTable(
+ name: "AppUserChatSettings");
+
+ migrationBuilder.DropTable(
+ name: "AppUserMessages");
+
+ migrationBuilder.DropTable(
+ name: "AppUserSpecialFocuss");
+
+ migrationBuilder.AlterColumn(
+ name: "ReadStatus",
+ table: "AppUserNotifications",
+ type: "tinyint",
+ nullable: false,
+ oldClrType: typeof(int));
+ }
+ }
+}
diff --git a/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs b/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs
index 8e253493d..8704b41fc 100644
--- a/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs
+++ b/aspnet-core/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs
@@ -17,6 +17,370 @@ namespace LINGYUN.Abp.MessageService.Migrations
.HasAnnotation("ProductVersion", "3.1.3")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.ChatGroup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("Address")
+ .HasColumnType("varchar(256) CHARACTER SET utf8mb4")
+ .HasMaxLength(256);
+
+ b.Property("AllowAnonymous")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowSendMessage")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("Description")
+ .HasColumnType("varchar(128) CHARACTER SET utf8mb4")
+ .HasMaxLength(128);
+
+ b.Property("GroupId")
+ .HasColumnType("bigint");
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId")
+ .HasColumnType("char(36)");
+
+ b.Property("MaxUserCount")
+ .HasColumnType("int");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(20) CHARACTER SET utf8mb4")
+ .HasMaxLength(20);
+
+ b.Property("Notice")
+ .HasColumnType("varchar(64) CHARACTER SET utf8mb4")
+ .HasMaxLength(64);
+
+ b.Property("Tag")
+ .HasColumnType("varchar(512) CHARACTER SET utf8mb4")
+ .HasMaxLength(512);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "Name");
+
+ b.ToTable("AppChatGroups");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.ChatGroupAdmin", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("AllowAddPeople")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowDissolveGroup")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowKickPeople")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowSendNotice")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowSilence")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("GroupId")
+ .HasColumnType("bigint");
+
+ b.Property("IsSuperAdmin")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("LastModifierId")
+ .HasColumnType("char(36)");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "GroupId");
+
+ b.ToTable("AppChatGroupAdmins");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.GroupChatBlack", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("GroupId")
+ .HasColumnType("bigint");
+
+ b.Property("ShieldUserId")
+ .HasColumnType("char(36)");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "GroupId");
+
+ b.ToTable("AppGroupChatBlacks");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.GroupMessage", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("longtext CHARACTER SET utf8mb4")
+ .HasMaxLength(1048576);
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("GroupId")
+ .HasColumnType("bigint");
+
+ b.Property("MessageId")
+ .HasColumnType("bigint");
+
+ b.Property("SendState")
+ .HasColumnType("tinyint");
+
+ b.Property("SendUserName")
+ .IsRequired()
+ .HasColumnType("varchar(64) CHARACTER SET utf8mb4")
+ .HasMaxLength(64);
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("Type")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "GroupId");
+
+ b.ToTable("AppGroupMessages");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatBlack", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("ShieldUserId")
+ .HasColumnType("char(36)");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "UserId");
+
+ b.ToTable("AppUserChatBlacks");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatGroup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("GroupId")
+ .HasColumnType("bigint");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "GroupId", "UserId");
+
+ b.ToTable("AppUserChatGroups");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserChatSetting", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("AllowAddFriend")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowAnonymous")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowReceiveMessage")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("AllowSendMessage")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("RequireAddFriendValition")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("TenantId")
+ .HasColumnName("TenantId")
+ .HasColumnType("char(36)");
+
+ b.Property("UserId")
+ .HasColumnType("char(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TenantId", "UserId");
+
+ b.ToTable("AppUserChatSettings");
+ });
+
+ modelBuilder.Entity("LINGYUN.Abp.MessageService.Messages.UserMessage", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("longtext CHARACTER SET utf8mb4")
+ .HasMaxLength(1048576);
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("CreatorId")
+ .HasColumnType("char(36)");
+
+ b.Property("MessageId")
+ .HasColumnType("bigint");
+
+ b.Property