refactor: 基础设施

This commit is contained in:
橙子
2023-02-19 11:34:15 +08:00
parent 961634981a
commit 8eda2cd814
9 changed files with 75 additions and 111 deletions

View File

@@ -84,6 +84,13 @@
</summary>
<returns></returns>
</member>
<member name="M:Yi.RBAC.Application.Identity.DeptService.GetListAsync(Yi.RBAC.Application.Contracts.Identity.Dtos.DeptGetListInputVo)">
<summary>
多查
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:Yi.RBAC.Application.Identity.MenuService">
<summary>
Menu服务实现

View File

@@ -28,24 +28,24 @@ namespace Yi.RBAC.Application.Identity
return await MapToGetListOutputDtosAsync(entities);
}
///// <summary>
///// 多查
///// </summary>
///// <param name="input"></param>
///// <returns></returns>
//public override async Task<PagedResultDto<DeptGetListOutputDto>> GetListAsync(DeptGetListInputVo input)
//{
// RefAsync<int> total = 0;
// var entities = await _DbQueryable
// .WhereIF(!string.IsNullOrEmpty(input.DeptName), u => u.DeptName.Contains(input.DeptName!))
// .WhereIF(input.State is not null, u => u.State == input.State)
// .OrderBy(u => u.OrderNum, OrderByType.Asc)
// .ToPageListAsync(input.PageNum, input.PageSize, total);
// return new PagedResultDto<DeptGetListOutputDto>
// {
// Items = await MapToGetListOutputDtosAsync(entities),
// Total = total
// };
//}
/// <summary>
/// 多查
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public override async Task<PagedResultDto<DeptGetListOutputDto>> GetListAsync(DeptGetListInputVo input)
{
RefAsync<int> total = 0;
var entities = await _DbQueryable
.WhereIF(!string.IsNullOrEmpty(input.DeptName), u => u.DeptName.Contains(input.DeptName!))
.WhereIF(input.State is not null, u => u.State == input.State)
.OrderBy(u => u.OrderNum, OrderByType.Asc)
.ToPageListAsync(input.PageNum, input.PageSize, total);
return new PagedResultDto<DeptGetListOutputDto>
{
Items = await MapToGetListOutputDtosAsync(entities),
Total = total
};
}
}
}

View File

@@ -104,6 +104,14 @@ namespace Yi.RBAC.Domain.Identity
return claims;
}
/// <summary>
/// 更新密码
/// </summary>
/// <param name="userId"></param>
/// <param name="newPassword"></param>
/// <param name="oldPassword"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
public async Task UpdatePasswordAsync(long userId, string newPassword, string oldPassword)
{
var user = await _repository.GetByIdAsync(userId);
@@ -117,7 +125,12 @@ namespace Yi.RBAC.Domain.Identity
await _repository.UpdateAsync(user);
}
/// <summary>
/// 重置密码
/// </summary>
/// <param name="userId"></param>
/// <param name="password"></param>
/// <returns></returns>
public async Task<bool> RestPasswordAsync(long userId, string password)
{
var user = await _repository.GetByIdAsync(userId);