IM/backend/IM_API/Models/Device.cs

42 lines
1.0 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("devices")]
[Index("Userid", Name = "Userid")]
[MySqlCharSet("utf8mb4")]
[MySqlCollation("utf8mb4_general_ci")]
public partial class Device
{
[Key]
[Column("ID", TypeName = "int(11)")]
public int Id { get; set; }
/// <summary>
/// 设备所属用户
/// </summary>
[Column(TypeName = "int(11)")]
public int Userid { get; set; }
/// <summary>
/// 设备类型(
/// 0:Android,1:Ios,2:PC,3Pad,4:未知)
/// </summary>
[Column("DType", TypeName = "tinyint(4)")]
public sbyte Dtype { get; set; }
/// <summary>
/// 最后一次登录
/// </summary>
[Column(TypeName = "datetime")]
public DateTime LastLogin { get; set; }
[ForeignKey("Userid")]
[InverseProperty("Devices")]
public virtual User User { get; set; } = null!;
}