using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Admin.NET.Core
{
///
/// 在线用户表
///
[Table("sys_online_user")]
[Comment("在线用户表")]
public class OnlineUser //: IEntity, IEntityTypeBuilder
{
///
/// 连接Id
///
[Comment("连接Id")]
public string ConnectionId { get; set; }
///
/// 用户Id
///
[Comment("用户Id")]
public long UserId { get; set; }
///
/// 账号
///
[Comment("账号")]
[Required, MaxLength(20)]
public string Account { get; set; }
///
/// 姓名
///
[Comment("姓名")]
[MaxLength(20)]
public string Name { get; set; }
///
/// 最后连接时间
///
[Comment("最近时间")]
public DateTimeOffset LastTime { get; set; }
///
/// 最后登录IP
///
[Comment("最后登录IP")]
[MaxLength(50)]
public string LastLoginIp { get; set; }
///
/// 最后登录所用浏览器
///
[Comment("最后登录所用浏览器")]
[MaxLength(20)]
public string LastLoginBrowser { get; set; }
///
/// 最后登录所用系统
///
[Comment("最后登录所用系统")]
[MaxLength(20)]
public string LastLoginOs { get; set; }
///
/// 租户id
///
//[Comment("租户id")]
//public long TenantId { get; set; }
public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)
{
entityBuilder.HasKey(c => new { c.UserId });
}
}
}