using IdentityService.Domain.Entities;
using IM.Commons;
using Microsoft.AspNetCore.Identity;
namespace IdentityService.Domain
{
public interface IIdRepository
{
///
/// 通过用户名查找
///
/// 用户名
///
Task FindByUserNameAsync(string userName);
///
/// 通过邮箱地址查找
///
/// 邮箱地址
///
Task FindByEmailAsync(string Email);
///
/// 通过ID查询
///
///
///
Task FindByIdAsync(Guid id);
///
/// 通过手机号查找
///
///
///
Task FindByPhoneAsync(string phone);
///
/// 创建用户
///
///
///
///
Task CreateAsync(User user, string password);
///
/// 修改密码
///
///
/// 原密码
///
Task ChangePasswordAsync(User user, string password);
///
/// 记录一次失败登录
///
///
///
Task AccessFailedAsync(User user);
///
/// 获取角色
///
///
///
Task> GetRolesAsync(User user);
///
/// 添加角色
///
///
///
///
Task AddRoleAsync(User user, string role);
///
/// 为登录检查用户名密码
///
///
///
/// 是否记录登录失败
///
Task CheckForSignInAsync(User user, string password, bool lockoutOnFailure);
///
/// 删除用户
///
///
///
Task RemoveAsync(User user);
///
/// 重置密码
///
///
///
Task<(IdentityResult, User?, string password)> ResetPasswordAsync(User user);
///
/// 检查用户名
///
///
///
Task CheckUsernameAsync(string username);
///
/// 检查邮箱
///
///
///
Task CheckEmailAsync(string email);
///
/// 检查手机号
///
///
///
Task CheckPhoneAsync(string phone);
///
/// 批量获取用户信息
///
///
///
Task> GetUsersAsync(ISpecification specification);
Task> GetUsersAsync(ISpecification specification);
}
}