123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- using MiniExcelLibs.Attributes;
- namespace Model
- {
- /// <summary>
- /// 用户表 sys_user
- /// </summary>
- [SugarTable("sys_user", "用户表")]
- [Tenant("0")]
- public class SysUser
- {
- /// <summary>
- /// 用户ID
- /// </summary>
- [SugarColumn(ColumnDescription = "用户ID", IsPrimaryKey = true, IsIdentity = true, ColumnName = "user_id")]
- public long userId { get; set; }
- /// <summary>
- /// 用户名
- /// </summary>
- [SugarColumn(ColumnDescription = "用户名", Length = 64, ColumnName = "username")]
- public string username { get; set; }
- /// <summary>
- /// 密码
- /// </summary>
- [SugarColumn(ColumnDescription = "密码", Length = 255, ColumnName = "password")]
- public string password { get; set; }
- /// <summary>
- /// 盐值
- /// </summary>
- [SugarColumn(ColumnDescription = "盐值", Length = 255, ColumnName = "salt")]
- public string salt { get; set; }
- /// <summary>
- /// 电话号码
- /// </summary>
- [SugarColumn(ColumnDescription = "电话号码", Length = 20, ColumnName = "phone")]
- public string phone { get; set; }
- /// <summary>
- /// 头像
- /// </summary>
- [SugarColumn(ColumnDescription = "头像", Length = 255, ColumnName = "avatar")]
- public string avatar { get; set; }
- /// <summary>
- /// 昵称
- /// </summary>
- [SugarColumn(ColumnDescription = "昵称", Length = 64, ColumnName = "nickname")]
- public string nickname { get; set; }
- /// <summary>
- /// 姓名
- /// </summary>
- [SugarColumn(ColumnDescription = "姓名", Length = 64, ColumnName = "name")]
- public string name { get; set; }
- /// <summary>
- /// 邮箱地址
- /// </summary>
- [SugarColumn(ColumnDescription = "邮箱地址", Length = 128, ColumnName = "email")]
- public string email { get; set; }
- /// <summary>
- /// 所属部门ID
- /// </summary>
- [SugarColumn(ColumnDescription = "所属部门ID", ColumnName = "dept_id")]
- public long deptId { get; set; }
- /// <summary>
- /// 创建人
- /// </summary>
- [SugarColumn(ColumnDescription = "创建人", Length = 64, ColumnName = "create_by")]
- public string CreateBy { get; set; }
- /// <summary>
- /// 修改人
- /// </summary>
- [SugarColumn(ColumnDescription = "修改人", Length = 64, ColumnName = "update_by")]
- public string UpdateBy { get; set; }
- /// <summary>
- /// 创建时间
- /// </summary>
- [SugarColumn(ColumnDescription = "创建时间", ColumnName = "create_time")]
- public DateTime? CreateTime { get; set; }
- /// <summary>
- /// 修改时间
- /// </summary>
- [SugarColumn(ColumnDescription = "修改时间", ColumnName = "update_time")]
- public DateTime? UpdateTime { get; set; }
- /// <summary>
- /// 锁定标记,0未锁定,9已锁定
- /// </summary>
- [SugarColumn(ColumnDescription = "锁定标记,0未锁定,9已锁定", Length = 1, ColumnName = "lock_flag")]
- public string LockFlag { get; set; }
- /// <summary>
- /// 删除标记,0未删除,1已删除
- /// </summary>
- [SugarColumn(ColumnDescription = "删除标记,0未删除,1已删除", Length = 1, ColumnName = "del_flag")]
- public string DelFlag { get; set; }
- /// <summary>
- /// 微信登录openId
- /// </summary>
- [SugarColumn(ColumnDescription = "微信登录openId", Length = 32, ColumnName = "wx_openid")]
- public string WxOpenid { get; set; }
- /// <summary>
- /// 小程序openId
- /// </summary>
- [SugarColumn(ColumnDescription = "小程序openId", Length = 32, ColumnName = "mini_openid")]
- public string MiniOpenid { get; set; }
- /// <summary>
- /// QQ openId
- /// </summary>
- [SugarColumn(ColumnDescription = "QQ openId", Length = 32, ColumnName = "qq_openid")]
- public string QqOpenid { get; set; }
- /// <summary>
- /// 码云标识
- /// </summary>
- [SugarColumn(ColumnDescription = "码云标识", Length = 100, ColumnName = "gitee_login")]
- public string GiteeLogin { get; set; }
- /// <summary>
- /// 开源中国标识
- /// </summary>
- [SugarColumn(ColumnDescription = "开源中国标识", Length = 100, ColumnName = "osc_id")]
- public string OscId { get; set; }
- /// <summary>
- /// 角色id集合
- /// </summary>
- [SugarColumn(IsIgnore = true)]
- [ExcelIgnore]
- public long[] RoleIds { get; set; }
- /// <summary>
- /// 岗位集合
- /// </summary>
- [SugarColumn(IsIgnore = true)]
- [ExcelIgnore]
- public int[] PostIds { get; set; }
- [SugarColumn(IsIgnore = true)]
- public List<SysRole> RoleList { get; set; }
- [SugarColumn(IsIgnore = true)]
- public List<SysPost> PostList { get; set; }
- public bool IsAdmin()
- {
- return IsAdmin(userId);
- }
- public static bool IsAdmin(long userId)
- {
- return 1 == userId;
- }
- }
- }
|