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; } /// /// 群聊名称 /// [StringLength(20)] public string Name { get; set; } = null!; /// /// 群主 /// [Column(TypeName = "int(11)")] public int GroupMaster { get; set; } /// /// 群权限 /// (0:需管理员同意,1:任意人可加群,2:不允许任何人加入) /// [Column(TypeName = "tinyint(4)")] public sbyte Auhority { get; set; } /// /// 全员禁言(0允许发言,2全员禁言) /// [Column(TypeName = "tinyint(4)")] public sbyte AllMembersBanned { get; set; } /// /// 群聊状态 /// (1:正常,2:封禁) /// [Column(TypeName = "tinyint(4)")] public sbyte Status { get; set; } /// /// 群公告 /// [Column(TypeName = "text")] public string? Announcement { get; set; } /// /// 群聊创建时间 /// [Column(TypeName = "datetime")] public DateTime Created { get; set; } [ForeignKey("GroupMaster")] [InverseProperty("Groups")] public virtual User GroupMasterNavigation { get; set; } = null!; [InverseProperty("Group")] public virtual ICollection Groupinvites { get; set; } = new List(); [InverseProperty("Group")] public virtual ICollection Grouprequests { get; set; } = new List(); }