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
+2 -21
View File
@@ -1,57 +1,38 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace IM_API.Models;
[Table("conversations")]
[Index("Userid", Name = "Userid")]
[Index("LastMessageId", Name = "lastMessageId")]
[MySqlCharSet("utf8mb4")]
[MySqlCollation("utf8mb4_general_ci")]
public partial class Conversation
{
[Key]
[Column("ID", TypeName = "int(11)")]
public int Id { get; set; }
/// <summary>
/// 用户
/// </summary>
[Column(TypeName = "int(11)")]
public int Userid { get; set; }
public int UserId { get; set; }
/// <summary>
/// 对方ID(群聊为群聊ID,单聊为单聊ID)
/// </summary>
[Column(TypeName = "int(11)")]
public int Targetid { get; set; }
public int TargetId { get; set; }
/// <summary>
/// 消息类型(同Messages.MsgType
/// </summary>
[Column(TypeName = "int(11)")]
public int MsgType { get; set; }
/// <summary>
/// 最后一条消息ID
/// </summary>
[Column("lastMessageId", TypeName = "int(11)")]
public int LastMessageId { get; set; }
/// <summary>
/// 未读消息数
/// </summary>
[Column("unreadCount", TypeName = "int(11)")]
public int UnreadCount { get; set; }
[ForeignKey("LastMessageId")]
[InverseProperty("Conversations")]
public virtual Message LastMessage { get; set; } = null!;
[ForeignKey("Userid")]
[InverseProperty("Conversations")]
public virtual User User { get; set; } = null!;
}