You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using Admin.Core.Model.Sys;
|
|
|
|
|
|
|
|
|
|
namespace Admin.Core.Model
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 用户视图
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class UserView
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 用户信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
public SysUser SysUser { get; set; } = new SysUser();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 部门对象
|
|
|
|
|
/// </summary>
|
|
|
|
|
public SysDept Dept { get; set; } = new SysDept();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 角色对象
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<RoleModel> Roles { get; set; } = new List<RoleModel>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 角色组 </summary>
|
|
|
|
|
public int?[] RoleIds { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 岗位对象
|
|
|
|
|
/// </summary>
|
|
|
|
|
public List<SysPost> Posts { get; set; } = new List<SysPost>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 岗位组 </summary>
|
|
|
|
|
public int?[] PostIds { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 是否为管理员
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="userId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static bool IsAdmin(int userId)
|
|
|
|
|
{
|
|
|
|
|
return 1 == userId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 管理员
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>管理员ID</returns>
|
|
|
|
|
public int Admin
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 用户数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class UserModel : SysUser
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 部门名称
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string DeptName { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|