fix 更新注释和role-list
This commit is contained in:
@@ -34,6 +34,17 @@ public class RolesController : ControllerBase
|
||||
return await _roleService.GetPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 角色列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Authorize(Roles = "admin")]
|
||||
[HttpGet("list")]
|
||||
public async Task<List<RoleRespone>> GetListAsync()
|
||||
{
|
||||
return await _roleService.GetListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分配角色
|
||||
/// </summary>
|
||||
|
||||
@@ -7,4 +7,9 @@ public class RoleRespone
|
||||
public string Name { get; set; }
|
||||
|
||||
public string NormalizedName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否可编辑
|
||||
/// </summary>
|
||||
public bool Editable => Id > 5;
|
||||
}
|
||||
|
||||
@@ -4,25 +4,58 @@ public class UserResponse
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账号名称
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规范化账号名称
|
||||
/// </summary>
|
||||
public string NormalizedUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮件
|
||||
/// </summary>
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规范化邮件
|
||||
/// </summary>
|
||||
public string NormalizedEmail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮件是否已确认
|
||||
/// </summary>
|
||||
public bool EmailConfirmed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 手机号是否已确认
|
||||
/// </summary>
|
||||
public bool PhoneNumberConfirmed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否开启双因素认证
|
||||
/// </summary>
|
||||
public bool TwoFactorEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 账号锁定结束时间
|
||||
/// </summary>
|
||||
public DateTime? LockoutEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否开启账号锁定功能
|
||||
/// </summary>
|
||||
public bool LockoutEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登陆失败次数
|
||||
/// </summary>
|
||||
public int AccessFailedCount { get; set; }
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ public interface IRoleService : IScopeDependency
|
||||
{
|
||||
Task<Pagination<RoleRespone>> GetPageAsync(RolePageRequest request);
|
||||
|
||||
Task<List<RoleRespone>> GetListAsync();
|
||||
|
||||
Task SaveRoleAsync(RoleSaveRequest request);
|
||||
|
||||
Task<RoleRespone> GetMyRoleAsync();
|
||||
|
||||
@@ -9,6 +9,7 @@ using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.Core.User.Abstractions;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Org.BouncyCastle.Asn1.Ocsp;
|
||||
|
||||
namespace Dlhis.Sys.Identity.Services.Implements;
|
||||
|
||||
@@ -172,4 +173,19 @@ public class RoleService : IRoleService
|
||||
await dbContext.DeleteReallyAsync(role);
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<List<RoleRespone>> GetListAsync()
|
||||
{
|
||||
return await Scoped.Request.Value.CreateAsync(async sp =>
|
||||
{
|
||||
var dbContext = sp.GetService<IDbContext>();
|
||||
var identityConnection = _configuration.GetSection("SqlSugarOptions:IdentityConnectionString").Value;
|
||||
dbContext.Client.CurrentConnectionConfig.ConnectionString = identityConnection;
|
||||
|
||||
|
||||
return await dbContext.Queryable<RoleEntity>()
|
||||
.Select<RoleRespone>()
|
||||
.ToListAsync();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user