IM/backend/IM_API/Models/Friend.cs

54 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace IM_API.Models;
[Table("friends")]
[Index("Id", Name = "ID")]
[Index("Userld", "Friendld", Name = "Userld")]
[Index("Friendld", Name = "用户2id")]
[MySqlCharSet("utf8mb4")]
[MySqlCollation("utf8mb4_general_ci")]
public partial class Friend
{
[Key]
[Column("ID", TypeName = "int(11)")]
public int Id { get; set; }
/// <summary>
/// 用户ID
/// </summary>
[Column(TypeName = "int(11)")]
public int Userld { get; set; }
/// <summary>
/// 用户2ID
/// </summary>
[Column(TypeName = "int(11)")]
public int Friendld { get; set; }
/// <summary>
/// 当前好友关系状态
/// 0待通过,1已添加,2已拒绝,3已拉黑
/// </summary>
[Column(TypeName = "tinyint(4)")]
public sbyte Status { get; set; }
/// <summary>
/// 好友关系创建时间
/// </summary>
[Column(TypeName = "datetime")]
public DateTime Created { get; set; }
[ForeignKey("Friendld")]
[InverseProperty("FriendFriendldNavigations")]
public virtual User FriendldNavigation { get; set; } = null!;
[ForeignKey("Userld")]
[InverseProperty("FriendUserldNavigations")]
public virtual User UserldNavigation { get; set; } = null!;
}