You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.3 KiB

using System.Collections.Generic;
namespace X1.Application.Features.Auth.Models;
/// <summary>
/// 用户信息
/// </summary>
public class UserInfo
{
/// <summary>
/// 用户ID
/// </summary>
public string Id { get; }
/// <summary>
/// 用户名
/// </summary>
public string UserName { get; }
/// <summary>
/// 真实姓名
/// </summary>
public string? RealName { get; }
/// <summary>
/// 邮箱
/// </summary>
public string Email { get; }
/// <summary>
/// 手机号
/// </summary>
public string? PhoneNumber { get; }
/// <summary>
/// 角色列表
/// </summary>
public IReadOnlyList<string> Roles { get; }
/// <summary>
/// 权限列表
/// </summary>
public IReadOnlyList<string> Permissions { get; }
/// <summary>
/// 初始化用户信息
/// </summary>
public UserInfo(
string id,
string userName,
string? realName,
string email,
string? phoneNumber,
IReadOnlyList<string> roles,
IReadOnlyList<string> permissions)
{
Id = id;
UserName = userName;
RealName = realName;
Email = email;
PhoneNumber = phoneNumber;
Roles = roles;
Permissions = permissions;
}
}