Merge branch 'feature-nxdev' of https://gitea.nxsir.cn/code/IM into feature-nxdev

This commit is contained in:
2025-10-30 14:44:00 +08:00
47 changed files with 1140 additions and 696 deletions
+3 -24
View File
@@ -1,73 +1,52 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace IM_API.Models;
[Table("groups")]
[Index("GroupMaster", Name = "GroupMaster")]
[Index("Id", Name = "ID")]
[MySqlCharSet("utf8mb4")]
[MySqlCollation("utf8mb4_general_ci")]
public partial class Group
{
[Key]
[Column("ID", TypeName = "int(11)")]
public int Id { get; set; }
/// <summary>
/// 群聊名称
/// </summary>
[StringLength(20)]
public string Name { get; set; } = null!;
/// <summary>
/// 群主
/// </summary>
[Column(TypeName = "int(11)")]
public int GroupMaster { get; set; }
/// <summary>
/// 群权限
/// (0:需管理员同意,1:任意人可加群,2:不允许任何人加入)
/// </summary>
[Column(TypeName = "tinyint(4)")]
public sbyte Auhority { get; set; }
/// <summary>
/// 全员禁言(0允许发言,2全员禁言)
/// </summary>
[Column(TypeName = "tinyint(4)")]
public sbyte AllMembersBanned { get; set; }
/// <summary>
/// 群聊状态
/// (1:正常,2:封禁)
/// </summary>
[Column(TypeName = "tinyint(4)")]
public sbyte Status { get; set; }
/// <summary>
/// 群公告
/// </summary>
[Column(TypeName = "text")]
public string? Announcement { get; set; }
/// <summary>
/// 群聊创建时间
/// </summary>
[Column(TypeName = "datetime")]
public DateTime Created { get; set; }
[ForeignKey("GroupMaster")]
[InverseProperty("Groups")]
public virtual ICollection<GroupInvite> GroupInvites { get; set; } = new List<GroupInvite>();
public virtual User GroupMasterNavigation { get; set; } = null!;
[InverseProperty("Group")]
public virtual ICollection<Groupinvite> Groupinvites { get; set; } = new List<Groupinvite>();
[InverseProperty("Group")]
public virtual ICollection<Grouprequest> Grouprequests { get; set; } = new List<Grouprequest>();
public virtual ICollection<GroupRequest> GroupRequests { get; set; } = new List<GroupRequest>();
}