Merge pull request '更新 📘 接口响应 Code 设计文档.md' (#7) from test into main

Reviewed-on: code/Chat#7
This commit is contained in:
2025-10-18 14:05:42 +08:00
committed by nanxun
60 changed files with 9583 additions and 1364 deletions
+73
View File
@@ -0,0 +1,73 @@
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 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>();
}