Files
wcs/WCS.DAL/Db/AuthDb/AuthModels.cs
hehaibing-1996 00621bcd55 1.增加盟讯公司业务逻辑相关适配 前后端增加配置参数“ISMX”进行控制
2.前端websocket取消心跳机制(原有心跳和断线重连当服务端网线断开后需要等tcp保活期到期后才能发现重连),自己实现心跳和重连
3.前端关闭后任占用后台线程问题修复
2024-05-25 17:25:27 +08:00

91 lines
2.9 KiB
C#
Raw Permalink 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 SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
using WCS.DAL.Db;
using WCS.Model;
namespace WCS.DAL.Db.AuthDb
{
/// <summary>
/// 用户
/// </summary>
[SugarTable("wcs_user")]
public class UserBase
{
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>
/// 登录名
/// </summary>
public string LoginName { get; set; }
/// <summary>
/// 密码
/// </summary>
public string Password { get; set; }
/// <summary>
/// 角色idjson
/// </summary>
[SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString, IsJson = true)]
public List<int> RoleIds { get; set; } = new List<int>();
/// <summary>
/// 角色名称
/// </summary>
[SugarColumn(IsIgnore = true)]
public List<string> RoleNames { get => RoleIds == null || !RoleIds.Any() ? new List<string>() : AuthDbHelp.db.Queryable<RoleBase>().Where(o => RoleIds.Contains(o.Id)).Select(o => o.Name).ToList(); }
/// <summary>
/// 是否最大权限
/// </summary>
public bool IsAdmin { get; set; }
///// <summary>
///// 是否是工程研发
///// </summary>
//[SugarColumn(ColumnName = "IsGCYF", IsNullable = true, ColumnDescription = "是否是工程研发人员")]
public bool IsGCYF { get; set; } = false;
/// <summary>
/// 创建时间
/// </summary>
public DateTime Time { get; set; }
/// <summary>
/// 用户所属角色
/// </summary>
[SugarColumn(IsIgnore = true)]
public List<RoleBase> GetRoles { get; set; }
}
/// <summary>
/// 角色
/// </summary>
[SugarTable("wcs_role")]
public class RoleBase
{
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>
/// 角色名
/// </summary>
public string Name { get; set; }
/// <summary>
/// 认证模块json
/// </summary>
[SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString, IsJson = true)]
public List<int> Auths { get; set; } = new List<int>();
/// <summary>
/// 认证模块名称
/// </summary>
[SugarColumn(IsIgnore = true)]
public List<string> AuthNames { get => Auths == null || !Auths.Any() ? new List<string>() : EnumHelps.GetEnumDescriptionList(typeof(AuthEnum), true).Where(o => Auths.Contains(o.Item1)).Select(o => o.Item3).ToList(); }
/// <summary>
/// 是否最大权限
/// </summary>
public bool IsAdmin { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime Time { get; set; }
}
}