using MessagePack;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace XPrintServer.DataModel.Models
{
///
///后台管理用户表
///
[SugarIndex("idx_{split_table}_create_time", nameof(CreateTime), OrderByType.Desc)]
[SplitTable(SplitType.Year)]//按年分表 (自带分表支持 年、季、月、周、日)
[SugarTable("backstage_user_{year}{month}{day}")]//3个变量必须要有,这么设计为了兼容开始按年,后面改成按月、按日
public partial class BackstageUser
{
public BackstageUser()
{
this.Platform = Convert.ToInt16("0");
}
///
/// Desc:Id
/// Default:
/// Nullable:False
///
[Key("Id")]
[SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键Id")]
public Guid Id { get; set; }
///
/// Desc:用户名
/// Default:
/// Nullable:False
///
[Key("UserName")]
[SugarColumn(IsNullable = false, ColumnDescription = "用户名")]
public string UserName { get; set; } = null!;
///
/// Desc:Password
/// Default:
/// Nullable:False
///
[Key("Password")]
[SugarColumn(IsNullable = false, ColumnDescription = "用户密码")]
public string Password { get; set; } = null!;
///
/// Desc:用户昵称
/// Default:
/// Nullable:True
///
[Key("NickName")]
[SugarColumn(IsNullable = true, ColumnDescription = "用户昵称")]
public string? NickName { get; set; }
///
/// Desc:Password
/// Default:
/// Nullable:True
///
[Key("IsActive")]
[SugarColumn(IsNullable = false, ColumnDescription = "用户是否是激活状态")]
public bool IsActive { get; set; } = false;
///
/// Desc:用户头像URL
/// Default:
/// Nullable:True
///
[Key("AvatarUrl")]
[SugarColumn(IsNullable = true, ColumnDescription = "用户头像URL")]
public string? AvatarUrl { get; set; }
///
/// Desc:登录平台: 1:微信端浏览器,2:PC端浏览器,3:android,4:iOS,5:微信小程序,0:未知。
/// Default:0
/// Nullable:False
///
[Key("Platform")]
[SugarColumn(ColumnDescription = "登录平台: 1:微信端浏览器,2:PC端浏览器,3:android,4:iOS,5:微信小程序,0:未知")]
public short Platform { get; set; }
///
/// Desc:注册时间
/// Default:
/// Nullable:True
///
[Key("RegisterTime")]
[SugarColumn(IsNullable = true, ColumnDescription = "注册时间")]
public DateTime? RegisterTime { get; set; }
///
/// Desc:最后登录时间
/// Default:
/// Nullable:True
///
[Key("LoginTime")]
[SugarColumn(IsNullable = true, ColumnDescription = "最后登录时间")]
public DateTime? LoginTime { get; set; }
///
/// Desc:
/// Default:
/// Nullable:False
///
[SugarColumn(IsNullable = false, ColumnDescription = "角色Id")]
public Guid RoleId { get; set; }
///
/// 分表字段 在插入的时候会根据这个字段插入哪个表,在更新删除的时候用这个字段找出相关表
///
[Key("CreateTime")]
[SplitField] //分表字段 在插入的时候会根据这个字段插入哪个表,在更新删除的时候用这个字段找出相关表
public DateTime CreateTime { get; set; }
}
}