diff --git a/backend/IMTest/bin/Debug/net8.0/IMTest.dll b/backend/IMTest/bin/Debug/net8.0/IMTest.dll
index 044ea8a..7676d44 100644
Binary files a/backend/IMTest/bin/Debug/net8.0/IMTest.dll and b/backend/IMTest/bin/Debug/net8.0/IMTest.dll differ
diff --git a/backend/IMTest/bin/Debug/net8.0/IMTest.pdb b/backend/IMTest/bin/Debug/net8.0/IMTest.pdb
index a3d1b90..39fed94 100644
Binary files a/backend/IMTest/bin/Debug/net8.0/IMTest.pdb and b/backend/IMTest/bin/Debug/net8.0/IMTest.pdb differ
diff --git a/backend/IMTest/bin/Debug/net8.0/IM_API.dll b/backend/IMTest/bin/Debug/net8.0/IM_API.dll
index 317926a..4b6dd57 100644
Binary files a/backend/IMTest/bin/Debug/net8.0/IM_API.dll and b/backend/IMTest/bin/Debug/net8.0/IM_API.dll differ
diff --git a/backend/IMTest/bin/Debug/net8.0/IM_API.exe b/backend/IMTest/bin/Debug/net8.0/IM_API.exe
index 598449d..4d58f5d 100644
Binary files a/backend/IMTest/bin/Debug/net8.0/IM_API.exe and b/backend/IMTest/bin/Debug/net8.0/IM_API.exe differ
diff --git a/backend/IMTest/bin/Debug/net8.0/IM_API.pdb b/backend/IMTest/bin/Debug/net8.0/IM_API.pdb
index 3ee5a3b..0d24bfb 100644
Binary files a/backend/IMTest/bin/Debug/net8.0/IM_API.pdb and b/backend/IMTest/bin/Debug/net8.0/IM_API.pdb differ
diff --git a/backend/IMTest/obj/Debug/net8.0/IMTest.AssemblyInfo.cs b/backend/IMTest/obj/Debug/net8.0/IMTest.AssemblyInfo.cs
index 29b15fd..ad92b28 100644
--- a/backend/IMTest/obj/Debug/net8.0/IMTest.AssemblyInfo.cs
+++ b/backend/IMTest/obj/Debug/net8.0/IMTest.AssemblyInfo.cs
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("IMTest")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2ecaa28091b41de707825db3628d380b62fa727f")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8d952578de8d3725b4fcad34056ce8cc01e73665")]
[assembly: System.Reflection.AssemblyProductAttribute("IMTest")]
[assembly: System.Reflection.AssemblyTitleAttribute("IMTest")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/backend/IMTest/obj/Debug/net8.0/IMTest.AssemblyInfoInputs.cache b/backend/IMTest/obj/Debug/net8.0/IMTest.AssemblyInfoInputs.cache
index d02a3dc..b1aa42c 100644
--- a/backend/IMTest/obj/Debug/net8.0/IMTest.AssemblyInfoInputs.cache
+++ b/backend/IMTest/obj/Debug/net8.0/IMTest.AssemblyInfoInputs.cache
@@ -1 +1 @@
-ed4980dfc7aff253176b260ed9015f9a80b52e92cbf3095eff3ed06865ea6e0d
+894ce5acc8690cb041ab936657887727ab47ceff5777afb7e84a8a31d3de838c
diff --git a/backend/IMTest/obj/Debug/net8.0/IMTest.csproj.AssemblyReference.cache b/backend/IMTest/obj/Debug/net8.0/IMTest.csproj.AssemblyReference.cache
index 2932c7a..0507af7 100644
Binary files a/backend/IMTest/obj/Debug/net8.0/IMTest.csproj.AssemblyReference.cache and b/backend/IMTest/obj/Debug/net8.0/IMTest.csproj.AssemblyReference.cache differ
diff --git a/backend/IMTest/obj/Debug/net8.0/IMTest.dll b/backend/IMTest/obj/Debug/net8.0/IMTest.dll
index 044ea8a..7676d44 100644
Binary files a/backend/IMTest/obj/Debug/net8.0/IMTest.dll and b/backend/IMTest/obj/Debug/net8.0/IMTest.dll differ
diff --git a/backend/IMTest/obj/Debug/net8.0/IMTest.pdb b/backend/IMTest/obj/Debug/net8.0/IMTest.pdb
index a3d1b90..39fed94 100644
Binary files a/backend/IMTest/obj/Debug/net8.0/IMTest.pdb and b/backend/IMTest/obj/Debug/net8.0/IMTest.pdb differ
diff --git a/backend/IMTest/obj/Debug/net8.0/ref/IMTest.dll b/backend/IMTest/obj/Debug/net8.0/ref/IMTest.dll
index 2793b43..46238b8 100644
Binary files a/backend/IMTest/obj/Debug/net8.0/ref/IMTest.dll and b/backend/IMTest/obj/Debug/net8.0/ref/IMTest.dll differ
diff --git a/backend/IMTest/obj/Debug/net8.0/refint/IMTest.dll b/backend/IMTest/obj/Debug/net8.0/refint/IMTest.dll
index 2793b43..46238b8 100644
Binary files a/backend/IMTest/obj/Debug/net8.0/refint/IMTest.dll and b/backend/IMTest/obj/Debug/net8.0/refint/IMTest.dll differ
diff --git a/backend/IM_API/.idea/.idea.IM_API/.idea/.gitignore b/backend/IM_API/.idea/.idea.IM_API/.idea/.gitignore
new file mode 100644
index 0000000..01c334b
--- /dev/null
+++ b/backend/IM_API/.idea/.idea.IM_API/.idea/.gitignore
@@ -0,0 +1,15 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Rider ignored files
+/modules.xml
+/projectSettingsUpdater.xml
+/.idea.IM_API.iml
+/contentModel.xml
+# Ignored default folder with query files
+/queries/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/backend/IM_API/.idea/.idea.IM_API/.idea/encodings.xml b/backend/IM_API/.idea/.idea.IM_API/.idea/encodings.xml
new file mode 100644
index 0000000..df87cf9
--- /dev/null
+++ b/backend/IM_API/.idea/.idea.IM_API/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/backend/IM_API/.idea/.idea.IM_API/.idea/indexLayout.xml b/backend/IM_API/.idea/.idea.IM_API/.idea/indexLayout.xml
new file mode 100644
index 0000000..7b08163
--- /dev/null
+++ b/backend/IM_API/.idea/.idea.IM_API/.idea/indexLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/backend/IM_API/.idea/.idea.IM_API/.idea/vcs.xml b/backend/IM_API/.idea/.idea.IM_API/.idea/vcs.xml
new file mode 100644
index 0000000..b2bdec2
--- /dev/null
+++ b/backend/IM_API/.idea/.idea.IM_API/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/backend/IM_API/Application/EventHandlers/FriendAddHandler/FriendAddSignalRHandler.cs b/backend/IM_API/Application/EventHandlers/FriendAddHandler/FriendAddSignalRHandler.cs
index e692035..021f3c3 100644
--- a/backend/IM_API/Application/EventHandlers/FriendAddHandler/FriendAddSignalRHandler.cs
+++ b/backend/IM_API/Application/EventHandlers/FriendAddHandler/FriendAddSignalRHandler.cs
@@ -22,7 +22,7 @@ namespace IM_API.Application.EventHandlers.FriendAddHandler
var usersList = new List {
@event.RequestUserId.ToString(), @event.ResponseUserId.ToString()
};
- var res = new HubResponse("Event", new MessageBaseDto()
+ var res = new HubResponse(HubResponseType.FriendAccepted, new MessageBaseDto()
{
ChatType = ChatType.PRIVATE,
Content = "您有新的好友关系已添加",
diff --git a/backend/IM_API/Application/EventHandlers/GroupInviteActionUpdateHandler/RequestDbHandler.cs b/backend/IM_API/Application/EventHandlers/GroupInviteActionUpdateHandler/RequestDbHandler.cs
index c5c7620..eec57dd 100644
--- a/backend/IM_API/Application/EventHandlers/GroupInviteActionUpdateHandler/RequestDbHandler.cs
+++ b/backend/IM_API/Application/EventHandlers/GroupInviteActionUpdateHandler/RequestDbHandler.cs
@@ -15,7 +15,7 @@ namespace IM_API.Application.EventHandlers.GroupInviteActionUpdateHandler
public async Task Consume(ConsumeContext context)
{
var @event = context.Message;
- if(@event.Action == Models.GroupInviteState.Passed)
+ if(@event.Action == Models.GroupRequestState.TargetPassed)
{
await _groupService.MakeGroupRequestAsync(@event.UserId, @event.InviteUserId,@event.GroupId);
}
diff --git a/backend/IM_API/Configs/MapperConfig.cs b/backend/IM_API/Configs/MapperConfig.cs
index 431657e..5fb327a 100644
--- a/backend/IM_API/Configs/MapperConfig.cs
+++ b/backend/IM_API/Configs/MapperConfig.cs
@@ -29,6 +29,7 @@ namespace IM_API.Configs
CreateMap()
.ForMember(dest => dest.Username,opt => opt.MapFrom(src => src.Username))
.ForMember(dest => dest.Password,opt => opt.MapFrom(src => src.Password))
+ .ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.Email))
.ForMember(dest => dest.Avatar,opt => opt.MapFrom(src => "https://ts1.tc.mm.bing.net/th/id/OIP-C.dl0WpkTP6E2J4FnhDC_jHwAAAA?rs=1&pid=ImgDetMain&o=7&rm=3"))
.ForMember(dest => dest.StatusEnum,opt => opt.MapFrom(src => UserStatus.Normal))
.ForMember(dest => dest.OnlineStatusEnum,opt => opt.MapFrom(src => UserOnlineStatus.Offline))
@@ -215,6 +216,34 @@ namespace IM_API.Configs
CreateMap()
.ForMember(dest => dest.Created, opt => opt.MapFrom(src => src.Created))
.ForMember(dest => dest.Role, opt => opt.MapFrom(src => src.RoleEnum));
+
+ //群更新模型
+
+ CreateMap()
+ .ForMember(dest => dest.Avatar, opt => opt.MapFrom(src => src.Avatar))
+ .ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.GroupName))
+ .ForMember(dest => dest.Announcement, opt => opt.MapFrom(src => src.Description))
+ .ForAllMembers(dest => dest.Ignore());
+
+ CreateMap()
+ .ForMember(dest => dest.Auhority, opt => opt.MapFrom(src => src.AuhorityEnum))
+ .ForMember(dest => dest.AllMembersBanned, opt => opt.MapFrom(src => src.AllMembersBannedEnum))
+ .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.StatusEnum))
+ ;
+
+ //群通知模型转换
+ CreateMap()
+ .ForMember(dest => dest.UserId, opt => opt.MapFrom(src => src.UserId))
+ .ForMember(dest => dest.GroupId, opt => opt.MapFrom(src => src.GroupId))
+ .ForMember(dest => dest.InviteUser, opt => opt.MapFrom(src => src.InviteUserId))
+ .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.StateEnum))
+ .ForMember(dest => dest.Description, opt => opt.MapFrom(src => src.Description))
+ .ForMember(dest => dest.RequestId, opt => opt.MapFrom(src => src.Id))
+ //.ForAllMembers(opt => opt.Ignore())
+ ;
+
+
+
}
}
}
diff --git a/backend/IM_API/Controllers/GroupController.cs b/backend/IM_API/Controllers/GroupController.cs
index 6dfdf8f..12bc59e 100644
--- a/backend/IM_API/Controllers/GroupController.cs
+++ b/backend/IM_API/Controllers/GroupController.cs
@@ -77,5 +77,33 @@ namespace IM_API.Controllers
var members = await _groupService.GetGroupMembers(int.Parse(useridStr), groupId);
return Ok(new BaseResponse>(members));
}
+
+ [HttpPost]
+ [ProducesResponseType(typeof(BaseResponse), StatusCodes.Status200OK)]
+
+ public async Task UpdateGroup([FromQuery]int groupId, [FromBody]GroupUpdateDto dto)
+ {
+ var useridStr = User.FindFirstValue(ClaimTypes.NameIdentifier);
+
+ var groupinfo = await _groupService.UpdateGroupInfoAsync(int.Parse(useridStr), groupId, dto);
+ return Ok(new BaseResponse(groupinfo));
+ }
+
+ [HttpGet]
+ [ProducesResponseType(typeof(BaseResponse), StatusCodes.Status200OK)]
+ public async Task GetGroupInfo([FromQuery]int groupId)
+ {
+ var group = await _groupService.GetGroupInfoAsync(groupId);
+ return Ok(new BaseResponse(group));
+ }
+
+ [HttpGet]
+ [ProducesResponseType(typeof(BaseResponse>), StatusCodes.Status200OK)]
+ public async Task GetGroupNotification([FromQuery]int groupId)
+ {
+ string userIdStr = User.FindFirstValue(ClaimTypes.NameIdentifier)!;
+ var data = await _groupService.GetGroupNotificationAsync(int.Parse(userIdStr));
+ return Ok(new BaseResponse>(data));
+ }
}
}
diff --git a/backend/IM_API/Domain/Events/GroupInviteActionUpdateEvent.cs b/backend/IM_API/Domain/Events/GroupInviteActionUpdateEvent.cs
index 3368dfe..2e0de1a 100644
--- a/backend/IM_API/Domain/Events/GroupInviteActionUpdateEvent.cs
+++ b/backend/IM_API/Domain/Events/GroupInviteActionUpdateEvent.cs
@@ -9,6 +9,6 @@ namespace IM_API.Domain.Events
public int InviteUserId { get; set; }
public int InviteId { get; set; }
public int GroupId { get; set; }
- public GroupInviteState Action { get; set; }
+ public GroupRequestState Action { get; set; }
}
}
diff --git a/backend/IM_API/Dtos/Auth/RegisterRequestDto.cs b/backend/IM_API/Dtos/Auth/RegisterRequestDto.cs
index c32dd87..e9d0efa 100644
--- a/backend/IM_API/Dtos/Auth/RegisterRequestDto.cs
+++ b/backend/IM_API/Dtos/Auth/RegisterRequestDto.cs
@@ -4,6 +4,8 @@ namespace IM_API.Dtos.Auth
{
public class RegisterRequestDto
{
+ [EmailAddress(ErrorMessage = "邮箱格式错误")]
+ public string Email { get; set; }
[Required(ErrorMessage = "用户名不能为空")]
[MaxLength(20, ErrorMessage = "用户名不能超过20字符")]
[RegularExpression(@"^[A-Za-z0-9]+$", ErrorMessage = "用户名只能为英文或数字")]
diff --git a/backend/IM_API/Dtos/Group/GroupUpdateDto.cs b/backend/IM_API/Dtos/Group/GroupUpdateDto.cs
new file mode 100644
index 0000000..27de73f
--- /dev/null
+++ b/backend/IM_API/Dtos/Group/GroupUpdateDto.cs
@@ -0,0 +1,10 @@
+namespace IM_API.Dtos.Group
+{
+ public class GroupUpdateDto
+ {
+ public string? GroupName { get; set; }
+ public string? Description { get; set; }
+ public string? Avatar { get; set; }
+
+ }
+}
diff --git a/backend/IM_API/Dtos/Group/HandleGroupInviteDto.cs b/backend/IM_API/Dtos/Group/HandleGroupInviteDto.cs
index 038a4bd..7f26982 100644
--- a/backend/IM_API/Dtos/Group/HandleGroupInviteDto.cs
+++ b/backend/IM_API/Dtos/Group/HandleGroupInviteDto.cs
@@ -5,6 +5,6 @@ namespace IM_API.Dtos.Group
public class HandleGroupInviteDto
{
public int InviteId { get; set; }
- public GroupInviteState Action { get; set; }
+ public GroupRequestState Action { get; set; }
}
}
diff --git a/backend/IM_API/Dtos/HubResponse.cs b/backend/IM_API/Dtos/HubResponse.cs
index 18c2c0e..c0dc9bb 100644
--- a/backend/IM_API/Dtos/HubResponse.cs
+++ b/backend/IM_API/Dtos/HubResponse.cs
@@ -39,11 +39,44 @@ namespace IM_API.Dtos
Message = codeDefine.Message;
Data = data;
}
+ public HubResponse(HubResponseType type, T? data)
+ {
+ Code = CodeDefine.SUCCESS.Code;
+ Method = "Event";
+ Type = type;
+ Data = data;
+ }
}
public enum HubResponseType
{
- ChatMsg = 1, // 聊天内容
- SystemNotice = 2, // 系统通知(如:申请好友成功)
- ActionStatus = 3 // 状态变更(如:对方正在输入、已读回执)
+ // --- 基础聊天 (10-19) ---
+ ChatMsg = 1, // 普通消息
+
+ // --- 系统与通知 (20-29) ---
+ SystemNotice = 2, // 通用系统通知
+ FriendRequest = 21, // 好友申请消息
+ FriendAccepted = 22, // 好友通过通知
+ UserInLine = 23, // 好友上线/下线通知
+
+ // --- 状态变更与交互 (30-39) ---
+ ActionStatus = 3, // 通用状态(正在输入等)
+ MsgReadReceipt = 31, // 已读回执
+ MsgRevoke = 32, // 消息撤回
+ MsgEdit = 33, // 消息二次编辑更新
+
+ // --- 群组管理 (40-49) ---
+ GroupInvited = 41, // 被邀请入群
+ GroupMemberUpdate = 42, // 群成员变动(进群/退群)
+ GroupAnnouncement = 43, // 群公告更新
+ GroupDismissed = 44, // 群组解散
+
+ // --- 实时通信控制 (50-59) ---
+ RTC_CallRequest = 51, // 音视频通话邀请
+ RTC_CallHandled = 52, // 音视频接听/挂断/取消状态
+
+ // --- 异常与安全 (90-99) ---
+ ErrorInternal = 91, // 服务器内部错误
+ TokenExpired = 92, // 登录过期,强制下线
+ KickedOut = 93 // 被挤下线(异地登录)
}
}
diff --git a/backend/IM_API/IM_API.sln.DotSettings.user b/backend/IM_API/IM_API.sln.DotSettings.user
new file mode 100644
index 0000000..3802d92
--- /dev/null
+++ b/backend/IM_API/IM_API.sln.DotSettings.user
@@ -0,0 +1,4 @@
+
+ True
+ /home/nanxun/dotnet/dotnet
+ /home/nanxun/dotnet/sdk/10.0.201/MSBuild.dll
\ No newline at end of file
diff --git a/backend/IM_API/Interface/Services/IGroupService.cs b/backend/IM_API/Interface/Services/IGroupService.cs
index fa7e4e8..67bfc8d 100644
--- a/backend/IM_API/Interface/Services/IGroupService.cs
+++ b/backend/IM_API/Interface/Services/IGroupService.cs
@@ -53,5 +53,15 @@ namespace IM_API.Interface.Services
Task MakeGroupRequestAsync(int userId,int? adminUserId,int groupId);
Task MakeGroupMemberAsync(int userId, int groupId, GroupMemberRole? role);
Task> GetGroupMembers(int userId, int groupId);
+ Task UpdateGroupInfoAsync(int userId, int groupId, GroupUpdateDto updateDto);
+
+ Task GetGroupInfoAsync(int groupId);
+
+ ///
+ /// 获取群聊通知
+ ///
+ ///
+ ///
+ Task> GetGroupNotificationAsync(int userId);
}
}
diff --git a/backend/IM_API/Migrations/20260309065303_update-group-announcement.Designer.cs b/backend/IM_API/Migrations/20260309065303_update-group-announcement.Designer.cs
new file mode 100644
index 0000000..27fcb46
--- /dev/null
+++ b/backend/IM_API/Migrations/20260309065303_update-group-announcement.Designer.cs
@@ -0,0 +1,1174 @@
+//
+using System;
+using IM_API.Models;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace IM_API.Migrations
+{
+ [DbContext(typeof(ImContext))]
+ [Migration("20260309065303_update-group-announcement")]
+ partial class updategroupannouncement
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .UseCollation("latin1_swedish_ci")
+ .HasAnnotation("ProductVersion", "8.0.21")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ MySqlModelBuilderExtensions.HasCharSet(modelBuilder, "latin1");
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
+ modelBuilder.Entity("IM_API.Models.Admin", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("创建时间 ");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("密码");
+
+ b.Property("RoleId")
+ .HasColumnType("int(11)")
+ .HasComment("角色");
+
+ b.Property("State")
+ .HasColumnType("tinyint(4)")
+ .HasComment("状态(0:正常,2:封禁) ");
+
+ b.Property("Updated")
+ .HasColumnType("datetime")
+ .HasComment("更新时间 ");
+
+ b.Property("Username")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("用户名");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "RoleId" }, "RoleId");
+
+ b.ToTable("admins", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Conversation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChatType")
+ .HasColumnType("int(11)");
+
+ b.Property("LastMessage")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)")
+ .HasComment("最后一条最新消息");
+
+ b.Property("LastMessageTime")
+ .HasColumnType("datetime")
+ .HasComment("最后一条消息发送时间");
+
+ b.Property("LastReadSequenceId")
+ .HasColumnType("int(11)")
+ .HasColumnName("lastReadMessageId")
+ .HasComment("最后一条未读消息ID ");
+
+ b.Property("MessageId")
+ .HasColumnType("int(11)");
+
+ b.Property("StreamKey")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)")
+ .HasComment("消息推送唯一标识符");
+
+ b.Property("TargetId")
+ .HasColumnType("int(11)")
+ .HasComment("对方ID(群聊为群聊ID,单聊为单聊ID) ");
+
+ b.Property("UnreadCount")
+ .HasColumnType("int(11)")
+ .HasComment("未读消息数 ");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("用户");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex("MessageId");
+
+ b.HasIndex(new[] { "LastReadSequenceId" }, "LastReadSequenceId");
+
+ b.HasIndex(new[] { "UserId" }, "Userid");
+
+ b.ToTable("conversations", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Device", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Dtype")
+ .HasColumnType("tinyint(4)")
+ .HasColumnName("DType")
+ .HasComment("设备类型(\r\n0:Android,1:Ios,2:PC,3:Pad,4:未知)");
+
+ b.Property("LastLogin")
+ .HasColumnType("datetime")
+ .HasComment("最后一次登录 ");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("设备所属用户 ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "UserId" }, "Userid")
+ .HasDatabaseName("Userid1");
+
+ b.ToTable("devices", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.File", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("创建时间 ");
+
+ b.Property("FileType")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("varchar(10)")
+ .HasComment("文件类型 ");
+
+ b.Property("MessageId")
+ .HasColumnType("int(11)")
+ .HasComment("关联消息ID ");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("文件名 ");
+
+ b.Property("Size")
+ .HasColumnType("int(11)")
+ .HasComment("文件大小(单位:KB) ");
+
+ b.Property("Url")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasColumnName("URL")
+ .HasComment("文件储存URL ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "MessageId" }, "Messageld");
+
+ b.ToTable("files", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Friend", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Avatar")
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)")
+ .HasComment("好友头像");
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("好友关系创建时间");
+
+ b.Property("FriendId")
+ .HasColumnType("int(11)")
+ .HasComment("用户2ID");
+
+ b.Property("RemarkName")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("好友备注名");
+
+ b.Property("Status")
+ .HasColumnType("tinyint(4)")
+ .HasComment("当前好友关系状态\r\n(0:待通过,1:已添加,2:已拒绝,3:已拉黑)");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("用户ID");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "Id" }, "ID");
+
+ b.HasIndex(new[] { "UserId", "FriendId" }, "Userld");
+
+ b.HasIndex(new[] { "FriendId" }, "用户2id");
+
+ b.ToTable("friends", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.FriendRequest", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("申请时间 ");
+
+ b.Property("Description")
+ .HasColumnType("text")
+ .HasComment("申请附言 ");
+
+ b.Property("RemarkName")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("备注");
+
+ b.Property("RequestUser")
+ .HasColumnType("int(11)")
+ .HasComment("申请人 ");
+
+ b.Property("ResponseUser")
+ .HasColumnType("int(11)")
+ .HasComment("被申请人 ");
+
+ b.Property("State")
+ .HasColumnType("tinyint(4)")
+ .HasComment("申请状态(0:待通过,1:拒绝,2:同意,3:拉黑) ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "RequestUser" }, "RequestUser");
+
+ b.HasIndex(new[] { "ResponseUser" }, "ResponseUser");
+
+ b.ToTable("friend_request", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Group", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("AllMembersBanned")
+ .HasColumnType("tinyint(4)")
+ .HasComment("全员禁言(0允许发言,2全员禁言)");
+
+ b.Property("Announcement")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasComment("群公告");
+
+ b.Property("Auhority")
+ .HasColumnType("tinyint(4)")
+ .HasComment("群权限\r\n(0:需管理员同意,1:任意人可加群,2:不允许任何人加入)");
+
+ b.Property("Avatar")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)")
+ .HasComment("群头像");
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("群聊创建时间");
+
+ b.Property("GroupMaster")
+ .HasColumnType("int(11)")
+ .HasComment("群主");
+
+ b.Property("LastMessage")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LastSenderName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LastUpdateTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("MaxSequenceId")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("群聊名称");
+
+ b.Property("Status")
+ .HasColumnType("tinyint(4)")
+ .HasComment("群聊状态\r\n(1:正常,2:封禁)");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "GroupMaster" }, "GroupMaster");
+
+ b.HasIndex(new[] { "Id" }, "ID")
+ .HasDatabaseName("ID1");
+
+ b.ToTable("groups", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.GroupInvite", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("创建时间");
+
+ b.Property("GroupId")
+ .HasColumnType("int(11)")
+ .HasComment("群聊编号");
+
+ b.Property("InviteUser")
+ .HasColumnType("int(11)")
+ .HasComment("邀请用户");
+
+ b.Property("InvitedUser")
+ .HasColumnType("int(11)")
+ .HasComment("被邀请用户");
+
+ b.Property("State")
+ .HasColumnType("tinyint(4)")
+ .HasComment("当前状态(0:待被邀请人同意\r\n1:被邀请人已同意)");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "GroupId" }, "GroupId");
+
+ b.HasIndex(new[] { "InviteUser" }, "InviteUser");
+
+ b.HasIndex(new[] { "InvitedUser" }, "InvitedUser");
+
+ b.ToTable("group_invite", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.GroupMember", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime")
+ .HasDefaultValueSql("'1970-01-01 00:00:00'")
+ .HasComment("加入群聊时间");
+
+ b.Property("GroupId")
+ .HasColumnType("int(11)")
+ .HasComment("群聊编号");
+
+ b.Property("Role")
+ .HasColumnType("tinyint(4)")
+ .HasComment("成员角色(0:普通成员,1:管理员,2:群主)");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("用户编号");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "GroupId" }, "Groupld");
+
+ b.HasIndex(new[] { "Id" }, "ID")
+ .HasDatabaseName("ID2");
+
+ b.HasIndex(new[] { "UserId" }, "Userld")
+ .HasDatabaseName("Userld1");
+
+ b.ToTable("group_member", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.GroupRequest", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("创建时间");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasComment("入群附言");
+
+ b.Property("GroupId")
+ .HasColumnType("int(11)")
+ .HasComment("群聊编号\r\n");
+
+ b.Property("State")
+ .HasColumnType("tinyint(4)")
+ .HasComment("申请状态(0:待管理员同意,1:已拒绝,2:已同意)");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("申请人 ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex("UserId");
+
+ b.HasIndex(new[] { "GroupId" }, "GroupId")
+ .HasDatabaseName("GroupId1");
+
+ b.ToTable("group_request", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.LoginLog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Dtype")
+ .HasColumnType("tinyint(4)")
+ .HasColumnName("DType")
+ .HasComment("设备类型(通Devices/DType) ");
+
+ b.Property("Logined")
+ .HasColumnType("datetime")
+ .HasComment("登录时间 ");
+
+ b.Property("State")
+ .HasColumnType("tinyint(4)")
+ .HasComment("登录状态(0:登陆成功,1:未验证,2:已被拒绝) ");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("登录用户 ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "UserId" }, "Userld")
+ .HasDatabaseName("Userld2");
+
+ b.ToTable("login_log", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Message", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChatType")
+ .HasColumnType("tinyint(4)")
+ .HasComment("聊天类型\r\n(0:私聊,1:群聊)");
+
+ b.Property("ClientMsgId")
+ .HasColumnType("char(36)");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasComment("消息内容 ");
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("发送时间 ");
+
+ b.Property("MsgType")
+ .HasColumnType("tinyint(4)")
+ .HasComment("消息类型\r\n(0:文本,1:图片,2:语音,3:视频,4:文件,5:语音聊天,6:视频聊天)");
+
+ b.Property("Recipient")
+ .HasColumnType("int(11)")
+ .HasComment("接收者(私聊为用户ID,群聊为群聊ID) ");
+
+ b.Property("Sender")
+ .HasColumnType("int(11)")
+ .HasComment("发送者 ");
+
+ b.Property("SequenceId")
+ .HasColumnType("bigint");
+
+ b.Property("State")
+ .HasColumnType("tinyint(4)")
+ .HasComment("消息状态(0:已发送,1:已撤回) ");
+
+ b.Property("StreamKey")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)")
+ .HasComment("消息推送唯一标识符");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex("SequenceId", "StreamKey")
+ .IsUnique();
+
+ b.HasIndex(new[] { "Sender" }, "Sender");
+
+ b.ToTable("messages", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Notification", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasComment("通知内容");
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("创建时间");
+
+ b.Property("Ntype")
+ .HasColumnType("tinyint(4)")
+ .HasColumnName("NType")
+ .HasComment("通知类型(0:文本)");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasMaxLength(40)
+ .HasColumnType("varchar(40)")
+ .HasComment("通知标题");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("接收人(为空为全体通知)");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "UserId" }, "Userld")
+ .HasDatabaseName("Userld3");
+
+ b.ToTable("notifications", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Permission", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Code")
+ .HasColumnType("int(11)")
+ .HasComment("权限编码 ");
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("创建时间 ");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("权限名称 ");
+
+ b.Property("Ptype")
+ .HasColumnType("int(11)")
+ .HasColumnName("PType")
+ .HasComment("权限类型(0:增,1:删,2:改,3:查) ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.ToTable("permissions", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Permissionarole", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ b.Property("PermissionId")
+ .HasColumnType("int(11)")
+ .HasComment("权限 ");
+
+ b.Property("RoleId")
+ .HasColumnType("int(11)")
+ .HasComment("角色 ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "PermissionId" }, "Permissionld");
+
+ b.HasIndex(new[] { "RoleId" }, "Roleld");
+
+ b.ToTable("permissionarole", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Role", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("创建时间 ");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasComment("角色描述 ");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("角色名称 ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.ToTable("roles", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Upload.UploadTask", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("char(36)");
+
+ b.Property("ChunkSize")
+ .HasColumnType("int");
+
+ b.Property("ContentType")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("FileHash")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("FileSize")
+ .HasColumnType("bigint");
+
+ b.Property("ObjectName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("ProviderUploadId")
+ .HasColumnType("longtext");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.Property("StorageProvider")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("TotalChunks")
+ .HasColumnType("int");
+
+ b.Property("Url")
+ .HasColumnType("longtext");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.ToTable("upload_tasks", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.User", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Avatar")
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)")
+ .HasComment("用户头像链接");
+
+ b.Property("Created")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime")
+ .HasDefaultValueSql("'1970-01-01 00:00:00'")
+ .HasComment("创建时间");
+
+ b.Property("IsDeleted")
+ .HasColumnType("tinyint(4)")
+ .HasComment("软删除标识\r\n0:账号正常\r\n1:账号已删除");
+
+ b.Property("NickName")
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("用户昵称");
+
+ b.Property("OnlineStatus")
+ .HasColumnType("tinyint(4)")
+ .HasComment("用户在线状态\r\n0(默认):不在线\r\n1:在线");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("密码");
+
+ b.Property("Status")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(4)")
+ .HasDefaultValueSql("'1'")
+ .HasComment("账户状态\r\n(0:未激活,1:正常,2:封禁)");
+
+ b.Property("Updated")
+ .HasColumnType("datetime")
+ .HasComment("修改时间");
+
+ b.Property("Username")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("唯一用户名");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "Id" }, "ID")
+ .HasDatabaseName("ID3");
+
+ b.HasIndex(new[] { "Username" }, "Username")
+ .IsUnique();
+
+ b.ToTable("users", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Admin", b =>
+ {
+ b.HasOne("IM_API.Models.Role", "Role")
+ .WithMany("Admins")
+ .HasForeignKey("RoleId")
+ .IsRequired()
+ .HasConstraintName("admins_ibfk_1");
+
+ b.Navigation("Role");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Conversation", b =>
+ {
+ b.HasOne("IM_API.Models.Message", null)
+ .WithMany("Conversations")
+ .HasForeignKey("MessageId");
+
+ b.HasOne("IM_API.Models.User", "User")
+ .WithMany("Conversations")
+ .HasForeignKey("UserId")
+ .IsRequired()
+ .HasConstraintName("conversations_ibfk_1");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Device", b =>
+ {
+ b.HasOne("IM_API.Models.User", "User")
+ .WithMany("Devices")
+ .HasForeignKey("UserId")
+ .IsRequired()
+ .HasConstraintName("devices_ibfk_1");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IM_API.Models.File", b =>
+ {
+ b.HasOne("IM_API.Models.Message", "Message")
+ .WithMany("Files")
+ .HasForeignKey("MessageId")
+ .IsRequired()
+ .HasConstraintName("files_ibfk_1");
+
+ b.Navigation("Message");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Friend", b =>
+ {
+ b.HasOne("IM_API.Models.User", "FriendNavigation")
+ .WithMany("FriendFriendNavigations")
+ .HasForeignKey("FriendId")
+ .IsRequired()
+ .HasConstraintName("用户2id");
+
+ b.HasOne("IM_API.Models.User", "User")
+ .WithMany("FriendUsers")
+ .HasForeignKey("UserId")
+ .IsRequired()
+ .HasConstraintName("用户id");
+
+ b.Navigation("FriendNavigation");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IM_API.Models.FriendRequest", b =>
+ {
+ b.HasOne("IM_API.Models.User", "RequestUserNavigation")
+ .WithMany("FriendRequestRequestUserNavigations")
+ .HasForeignKey("RequestUser")
+ .IsRequired()
+ .HasConstraintName("friend_request_ibfk_1");
+
+ b.HasOne("IM_API.Models.User", "ResponseUserNavigation")
+ .WithMany("FriendRequestResponseUserNavigations")
+ .HasForeignKey("ResponseUser")
+ .IsRequired()
+ .HasConstraintName("friend_request_ibfk_2");
+
+ b.Navigation("RequestUserNavigation");
+
+ b.Navigation("ResponseUserNavigation");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Group", b =>
+ {
+ b.HasOne("IM_API.Models.User", "GroupMasterNavigation")
+ .WithMany("Groups")
+ .HasForeignKey("GroupMaster")
+ .IsRequired()
+ .HasConstraintName("groups_ibfk_1");
+
+ b.Navigation("GroupMasterNavigation");
+ });
+
+ modelBuilder.Entity("IM_API.Models.GroupInvite", b =>
+ {
+ b.HasOne("IM_API.Models.Group", "Group")
+ .WithMany("GroupInvites")
+ .HasForeignKey("GroupId")
+ .IsRequired()
+ .HasConstraintName("group_invite_ibfk_2");
+
+ b.HasOne("IM_API.Models.User", "InviteUserNavigation")
+ .WithMany("GroupInviteInviteUserNavigations")
+ .HasForeignKey("InviteUser")
+ .HasConstraintName("group_invite_ibfk_1");
+
+ b.HasOne("IM_API.Models.User", "InvitedUserNavigation")
+ .WithMany("GroupInviteInvitedUserNavigations")
+ .HasForeignKey("InvitedUser")
+ .HasConstraintName("group_invite_ibfk_3");
+
+ b.Navigation("Group");
+
+ b.Navigation("InviteUserNavigation");
+
+ b.Navigation("InvitedUserNavigation");
+ });
+
+ modelBuilder.Entity("IM_API.Models.GroupMember", b =>
+ {
+ b.HasOne("IM_API.Models.Group", "Group")
+ .WithMany("GroupMembers")
+ .HasForeignKey("GroupId")
+ .IsRequired()
+ .HasConstraintName("group_member_ibfk_2");
+
+ b.HasOne("IM_API.Models.User", "User")
+ .WithMany("GroupMembers")
+ .HasForeignKey("UserId")
+ .IsRequired()
+ .HasConstraintName("group_member_ibfk_1");
+
+ b.Navigation("Group");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IM_API.Models.GroupRequest", b =>
+ {
+ b.HasOne("IM_API.Models.Group", "Group")
+ .WithMany("GroupRequests")
+ .HasForeignKey("GroupId")
+ .IsRequired()
+ .HasConstraintName("group_request_ibfk_1");
+
+ b.HasOne("IM_API.Models.User", "User")
+ .WithMany("GroupRequests")
+ .HasForeignKey("UserId")
+ .IsRequired()
+ .HasConstraintName("group_request_ibfk_2");
+
+ b.Navigation("Group");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IM_API.Models.LoginLog", b =>
+ {
+ b.HasOne("IM_API.Models.User", "User")
+ .WithMany("LoginLogs")
+ .HasForeignKey("UserId")
+ .IsRequired()
+ .HasConstraintName("login_log_ibfk_1");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Message", b =>
+ {
+ b.HasOne("IM_API.Models.User", "SenderNavigation")
+ .WithMany("Messages")
+ .HasForeignKey("Sender")
+ .IsRequired()
+ .HasConstraintName("messages_ibfk_1");
+
+ b.Navigation("SenderNavigation");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Notification", b =>
+ {
+ b.HasOne("IM_API.Models.User", "User")
+ .WithMany("Notifications")
+ .HasForeignKey("UserId")
+ .IsRequired()
+ .HasConstraintName("notifications_ibfk_1");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Permissionarole", b =>
+ {
+ b.HasOne("IM_API.Models.Permission", "Permission")
+ .WithMany("Permissionaroles")
+ .HasForeignKey("PermissionId")
+ .IsRequired()
+ .HasConstraintName("permissionarole_ibfk_2");
+
+ b.HasOne("IM_API.Models.Role", "Role")
+ .WithMany("Permissionaroles")
+ .HasForeignKey("RoleId")
+ .IsRequired()
+ .HasConstraintName("permissionarole_ibfk_1");
+
+ b.Navigation("Permission");
+
+ b.Navigation("Role");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Group", b =>
+ {
+ b.Navigation("GroupInvites");
+
+ b.Navigation("GroupMembers");
+
+ b.Navigation("GroupRequests");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Message", b =>
+ {
+ b.Navigation("Conversations");
+
+ b.Navigation("Files");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Permission", b =>
+ {
+ b.Navigation("Permissionaroles");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Role", b =>
+ {
+ b.Navigation("Admins");
+
+ b.Navigation("Permissionaroles");
+ });
+
+ modelBuilder.Entity("IM_API.Models.User", b =>
+ {
+ b.Navigation("Conversations");
+
+ b.Navigation("Devices");
+
+ b.Navigation("FriendFriendNavigations");
+
+ b.Navigation("FriendRequestRequestUserNavigations");
+
+ b.Navigation("FriendRequestResponseUserNavigations");
+
+ b.Navigation("FriendUsers");
+
+ b.Navigation("GroupInviteInviteUserNavigations");
+
+ b.Navigation("GroupInviteInvitedUserNavigations");
+
+ b.Navigation("GroupMembers");
+
+ b.Navigation("GroupRequests");
+
+ b.Navigation("Groups");
+
+ b.Navigation("LoginLogs");
+
+ b.Navigation("Messages");
+
+ b.Navigation("Notifications");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/backend/IM_API/Migrations/20260309065303_update-group-announcement.cs b/backend/IM_API/Migrations/20260309065303_update-group-announcement.cs
new file mode 100644
index 0000000..44cea10
--- /dev/null
+++ b/backend/IM_API/Migrations/20260309065303_update-group-announcement.cs
@@ -0,0 +1,54 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace IM_API.Migrations
+{
+ ///
+ public partial class updategroupannouncement : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.UpdateData(
+ table: "groups",
+ keyColumn: "Announcement",
+ keyValue: null,
+ column: "Announcement",
+ value: "");
+
+ migrationBuilder.AlterColumn(
+ name: "Announcement",
+ table: "groups",
+ type: "text",
+ nullable: false,
+ comment: "群公告",
+ collation: "utf8mb4_general_ci",
+ oldClrType: typeof(string),
+ oldType: "text",
+ oldNullable: true,
+ oldComment: "群公告")
+ .Annotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("Relational:Collation", "utf8mb4_general_ci");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn(
+ name: "Announcement",
+ table: "groups",
+ type: "text",
+ nullable: true,
+ comment: "群公告",
+ collation: "utf8mb4_general_ci",
+ oldClrType: typeof(string),
+ oldType: "text",
+ oldComment: "群公告")
+ .Annotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("Relational:Collation", "utf8mb4_general_ci");
+ }
+ }
+}
diff --git a/backend/IM_API/Migrations/20260312094604_group-invite-request-merge.Designer.cs b/backend/IM_API/Migrations/20260312094604_group-invite-request-merge.Designer.cs
new file mode 100644
index 0000000..e2229a8
--- /dev/null
+++ b/backend/IM_API/Migrations/20260312094604_group-invite-request-merge.Designer.cs
@@ -0,0 +1,1101 @@
+//
+using System;
+using IM_API.Models;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace IM_API.Migrations
+{
+ [DbContext(typeof(ImContext))]
+ [Migration("20260312094604_group-invite-request-merge")]
+ partial class groupinviterequestmerge
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .UseCollation("latin1_swedish_ci")
+ .HasAnnotation("ProductVersion", "8.0.21")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ MySqlModelBuilderExtensions.HasCharSet(modelBuilder, "latin1");
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
+ modelBuilder.Entity("IM_API.Models.Admin", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("创建时间 ");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("密码");
+
+ b.Property("RoleId")
+ .HasColumnType("int(11)")
+ .HasComment("角色");
+
+ b.Property("State")
+ .HasColumnType("tinyint(4)")
+ .HasComment("状态(0:正常,2:封禁) ");
+
+ b.Property("Updated")
+ .HasColumnType("datetime")
+ .HasComment("更新时间 ");
+
+ b.Property("Username")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("用户名");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "RoleId" }, "RoleId");
+
+ b.ToTable("admins", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Conversation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChatType")
+ .HasColumnType("int(11)");
+
+ b.Property("LastMessage")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)")
+ .HasComment("最后一条最新消息");
+
+ b.Property("LastMessageTime")
+ .HasColumnType("datetime")
+ .HasComment("最后一条消息发送时间");
+
+ b.Property("LastReadSequenceId")
+ .HasColumnType("int(11)")
+ .HasColumnName("lastReadMessageId")
+ .HasComment("最后一条未读消息ID ");
+
+ b.Property("MessageId")
+ .HasColumnType("int(11)");
+
+ b.Property("StreamKey")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)")
+ .HasComment("消息推送唯一标识符");
+
+ b.Property("TargetId")
+ .HasColumnType("int(11)")
+ .HasComment("对方ID(群聊为群聊ID,单聊为单聊ID) ");
+
+ b.Property("UnreadCount")
+ .HasColumnType("int(11)")
+ .HasComment("未读消息数 ");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("用户");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex("MessageId");
+
+ b.HasIndex(new[] { "LastReadSequenceId" }, "LastReadSequenceId");
+
+ b.HasIndex(new[] { "UserId" }, "Userid");
+
+ b.ToTable("conversations", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Device", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Dtype")
+ .HasColumnType("tinyint(4)")
+ .HasColumnName("DType")
+ .HasComment("设备类型(\r\n0:Android,1:Ios,2:PC,3:Pad,4:未知)");
+
+ b.Property("LastLogin")
+ .HasColumnType("datetime")
+ .HasComment("最后一次登录 ");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("设备所属用户 ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "UserId" }, "Userid")
+ .HasDatabaseName("Userid1");
+
+ b.ToTable("devices", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.File", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("创建时间 ");
+
+ b.Property("FileType")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("varchar(10)")
+ .HasComment("文件类型 ");
+
+ b.Property("MessageId")
+ .HasColumnType("int(11)")
+ .HasComment("关联消息ID ");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("varchar(50)")
+ .HasComment("文件名 ");
+
+ b.Property("Size")
+ .HasColumnType("int(11)")
+ .HasComment("文件大小(单位:KB) ");
+
+ b.Property("Url")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("varchar(100)")
+ .HasColumnName("URL")
+ .HasComment("文件储存URL ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "MessageId" }, "Messageld");
+
+ b.ToTable("files", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Friend", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Avatar")
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)")
+ .HasComment("好友头像");
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("好友关系创建时间");
+
+ b.Property("FriendId")
+ .HasColumnType("int(11)")
+ .HasComment("用户2ID");
+
+ b.Property("RemarkName")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("好友备注名");
+
+ b.Property("Status")
+ .HasColumnType("tinyint(4)")
+ .HasComment("当前好友关系状态\r\n(0:待通过,1:已添加,2:已拒绝,3:已拉黑)");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("用户ID");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "Id" }, "ID");
+
+ b.HasIndex(new[] { "UserId", "FriendId" }, "Userld");
+
+ b.HasIndex(new[] { "FriendId" }, "用户2id");
+
+ b.ToTable("friends", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.FriendRequest", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("申请时间 ");
+
+ b.Property("Description")
+ .HasColumnType("text")
+ .HasComment("申请附言 ");
+
+ b.Property("RemarkName")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("备注");
+
+ b.Property("RequestUser")
+ .HasColumnType("int(11)")
+ .HasComment("申请人 ");
+
+ b.Property("ResponseUser")
+ .HasColumnType("int(11)")
+ .HasComment("被申请人 ");
+
+ b.Property("State")
+ .HasColumnType("tinyint(4)")
+ .HasComment("申请状态(0:待通过,1:拒绝,2:同意,3:拉黑) ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "RequestUser" }, "RequestUser");
+
+ b.HasIndex(new[] { "ResponseUser" }, "ResponseUser");
+
+ b.ToTable("friend_request", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Group", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("AllMembersBanned")
+ .HasColumnType("tinyint(4)")
+ .HasComment("全员禁言(0允许发言,2全员禁言)");
+
+ b.Property("Announcement")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasComment("群公告");
+
+ b.Property("Auhority")
+ .HasColumnType("tinyint(4)")
+ .HasComment("群权限\r\n(0:需管理员同意,1:任意人可加群,2:不允许任何人加入)");
+
+ b.Property("Avatar")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("varchar(255)")
+ .HasComment("群头像");
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("群聊创建时间");
+
+ b.Property("GroupMaster")
+ .HasColumnType("int(11)")
+ .HasComment("群主");
+
+ b.Property("LastMessage")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LastSenderName")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("LastUpdateTime")
+ .HasColumnType("datetime(6)");
+
+ b.Property("MaxSequenceId")
+ .HasColumnType("bigint");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("varchar(20)")
+ .HasComment("群聊名称");
+
+ b.Property("Status")
+ .HasColumnType("tinyint(4)")
+ .HasComment("群聊状态\r\n(1:正常,2:封禁)");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "GroupMaster" }, "GroupMaster");
+
+ b.HasIndex(new[] { "Id" }, "ID")
+ .HasDatabaseName("ID1");
+
+ b.ToTable("groups", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.GroupMember", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("datetime")
+ .HasDefaultValueSql("'1970-01-01 00:00:00'")
+ .HasComment("加入群聊时间");
+
+ b.Property("GroupId")
+ .HasColumnType("int(11)")
+ .HasComment("群聊编号");
+
+ b.Property("Role")
+ .HasColumnType("tinyint(4)")
+ .HasComment("成员角色(0:普通成员,1:管理员,2:群主)");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("用户编号");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "GroupId" }, "Groupld");
+
+ b.HasIndex(new[] { "Id" }, "ID")
+ .HasDatabaseName("ID2");
+
+ b.HasIndex(new[] { "UserId" }, "Userld")
+ .HasDatabaseName("Userld1");
+
+ b.ToTable("group_member", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.GroupRequest", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime")
+ .HasComment("创建时间");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasComment("入群附言");
+
+ b.Property("GroupId")
+ .HasColumnType("int(11)")
+ .HasComment("群聊编号\r\n");
+
+ b.Property("InviteUserId")
+ .HasColumnType("int");
+
+ b.Property("State")
+ .HasColumnType("tinyint(4)")
+ .HasComment("申请状态(0:待管理员同意,1:已拒绝,2:已同意)");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("申请人 ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex("UserId");
+
+ b.HasIndex(new[] { "GroupId" }, "GroupId");
+
+ b.ToTable("group_request", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.LoginLog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Dtype")
+ .HasColumnType("tinyint(4)")
+ .HasColumnName("DType")
+ .HasComment("设备类型(通Devices/DType) ");
+
+ b.Property("Logined")
+ .HasColumnType("datetime")
+ .HasComment("登录时间 ");
+
+ b.Property("State")
+ .HasColumnType("tinyint(4)")
+ .HasComment("登录状态(0:登陆成功,1:未验证,2:已被拒绝) ");
+
+ b.Property("UserId")
+ .HasColumnType("int(11)")
+ .HasComment("登录用户 ");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.HasIndex(new[] { "UserId" }, "Userld")
+ .HasDatabaseName("Userld2");
+
+ b.ToTable("login_log", (string)null);
+
+ MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
+ MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
+ });
+
+ modelBuilder.Entity("IM_API.Models.Message", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("ID");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property