feat: 完善各个模块功能
This commit is contained in:
@@ -9,6 +9,7 @@ using Yi.Framework.AspNetCore.Microsoft.Extensions.DependencyInjection;
|
||||
using Yi.Framework.Core.Autofac;
|
||||
using Yi.RBAC.Application;
|
||||
using Yi.Framework.AspNetCore;
|
||||
using Yi.Framework.Data.Json;
|
||||
|
||||
namespace Yi.BBS.Web
|
||||
{
|
||||
@@ -23,7 +24,9 @@ namespace Yi.BBS.Web
|
||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||
{
|
||||
//添加控制器与动态api
|
||||
services.AddControllers();
|
||||
services.AddControllers().AddJsonOptions(opt => {
|
||||
opt.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss"));
|
||||
});
|
||||
services.AddAutoApiService(opt =>
|
||||
{
|
||||
//NETServiceTest所在程序集添加进动态api配置
|
||||
|
||||
@@ -5,6 +5,7 @@ using Yi.Framework.Auth.JwtBearer;
|
||||
using Yi.Framework.Core;
|
||||
using Yi.Framework.Core.Attributes;
|
||||
using Yi.Framework.Core.Autofac;
|
||||
using Yi.Framework.Data.Json;
|
||||
using Yi.Template.Application;
|
||||
using Yi.Template.Sqlsugar;
|
||||
|
||||
@@ -21,7 +22,9 @@ namespace Yi.Template.Web
|
||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||
{
|
||||
//添加控制器与动态api
|
||||
services.AddControllers();
|
||||
services.AddControllers().AddJsonOptions(opt => {
|
||||
opt.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss"));
|
||||
});
|
||||
services.AddAutoApiService(opt =>
|
||||
{
|
||||
//NETServiceTest所在程序集添加进动态api配置
|
||||
|
||||
@@ -9,6 +9,7 @@ using Yi.Framework.AspNetCore.Microsoft.Extensions.DependencyInjection;
|
||||
using Yi.Framework.Core.Autofac;
|
||||
using Yi.RBAC.Application;
|
||||
using Yi.Framework.AspNetCore;
|
||||
using Yi.Framework.Data.Json;
|
||||
|
||||
namespace Yi.BBS.Web
|
||||
{
|
||||
@@ -23,7 +24,9 @@ namespace Yi.BBS.Web
|
||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||
{
|
||||
//添加控制器与动态api
|
||||
services.AddControllers();
|
||||
services.AddControllers().AddJsonOptions(opt => {
|
||||
opt.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss"));
|
||||
});
|
||||
services.AddAutoApiService(opt =>
|
||||
{
|
||||
//NETServiceTest所在程序集添加进动态api配置
|
||||
|
||||
@@ -18,5 +18,7 @@ namespace Yi.RBAC.Application.Contracts.Identity.Dtos
|
||||
public string? Leader { get; set; }
|
||||
public long ParentId { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
|
||||
public int OrderNum { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,5 +17,9 @@ namespace Yi.RBAC.Application.Contracts.Identity.Dtos
|
||||
public string? Remark { get; set; }
|
||||
|
||||
public long? deptId { get; set; }
|
||||
|
||||
public int OrderNum { get; set; }
|
||||
|
||||
public long ParentId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ namespace Yi.RBAC.Application.Contracts.Identity.Dtos
|
||||
public string? Remark { get; set; }
|
||||
public string? Component { get; set; }
|
||||
public string? Query { get; set; }
|
||||
|
||||
public int OrderNum { get; set; }
|
||||
//public List<MenuEntity>? Children { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ namespace Yi.RBAC.Application.Contracts.Identity.Dtos
|
||||
public string? Remark { get; set; }
|
||||
public string? Component { get; set; }
|
||||
public string? Query { get; set; }
|
||||
|
||||
public int OrderNum { get; set; }
|
||||
|
||||
//public List<MenuEntity>? Children { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,5 +15,7 @@ namespace Yi.RBAC.Application.Contracts.Identity.Dtos
|
||||
public string PostCode { get; set; }=string.Empty;
|
||||
public string PostName { get; set; } = string.Empty;
|
||||
public string? Remark { get; set; }
|
||||
|
||||
public int OrderNum { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,5 +16,7 @@ namespace Yi.RBAC.Application.Contracts.Identity.Dtos
|
||||
public string PostCode { get; set; }=string.Empty;
|
||||
public string PostName { get; set; } = string.Empty;
|
||||
public string? Remark { get; set; }
|
||||
|
||||
public int OrderNum { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,9 @@ namespace Yi.RBAC.Application.Contracts.Identity.Dtos
|
||||
public string? UserName { get; set; }
|
||||
public long? Phone { get; set; }
|
||||
|
||||
public bool IsDeleted { get; set; }
|
||||
public bool? State { get; set; }
|
||||
|
||||
public long? DeptId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ namespace Yi.RBAC.Application.Contracts.Identity.Dtos
|
||||
public string? Name { get; set; }
|
||||
public int? Age { get; set; }
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
public string Salt { get; set; } = string.Empty;
|
||||
public string? Icon { get; set; }
|
||||
public string? Nick { get; set; }
|
||||
public string? Email { get; set; }
|
||||
@@ -30,5 +28,8 @@ namespace Yi.RBAC.Application.Contracts.Identity.Dtos
|
||||
public long? CreatorId { get; set; }
|
||||
|
||||
public bool State { get; set; }
|
||||
|
||||
|
||||
public string DeptName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +120,14 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.RBAC.Application.Identity.RoleService.UpdateAsync(System.Int64,Yi.RBAC.Application.Contracts.Identity.Dtos.RoleUpdateInputVo)">
|
||||
<summary>
|
||||
修改角色
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Identity.UserService">
|
||||
<summary>
|
||||
User服务实现
|
||||
|
||||
@@ -41,5 +41,28 @@ namespace Yi.RBAC.Application.Identity
|
||||
|
||||
return outputDto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改角色
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<RoleGetOutputDto> UpdateAsync(long id, RoleUpdateInputVo input)
|
||||
{
|
||||
var dto = new RoleGetOutputDto();
|
||||
using (var uow = _unitOfWorkManager.CreateContext())
|
||||
{
|
||||
var entity = await _repository.GetByIdAsync(id);
|
||||
await MapToEntityAsync(input, entity);
|
||||
await _repository.UpdateAsync(entity);
|
||||
|
||||
await _roleManager.GiveRoleSetMenuAsync(new List<long> { id }, input.MenuIds);
|
||||
|
||||
dto = await MapToGetOutputDtoAsync(entity);
|
||||
uow.Commit();
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,13 +40,21 @@ namespace Yi.RBAC.Application.Identity
|
||||
|
||||
RefAsync<int> total = 0;
|
||||
|
||||
var entities = await _DbQueryable.WhereIF(!string.IsNullOrEmpty(input.UserName), x => x.UserName.Contains(input.UserName!)).
|
||||
WhereIF(input.Phone is not null, x => x.Phone.ToString()!.Contains(input.Phone.ToString()!)).
|
||||
WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name!.Contains(input.Name!)).
|
||||
WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime).ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||
var outPut = await _DbQueryable.WhereIF(!string.IsNullOrEmpty(input.UserName), x => x.UserName.Contains(input.UserName!))
|
||||
.WhereIF(input.Phone is not null, x => x.Phone.ToString()!.Contains(input.Phone.ToString()!))
|
||||
.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name!.Contains(input.Name!))
|
||||
.WhereIF(input.State is not null, x => x.State == input.State)
|
||||
.WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime)
|
||||
|
||||
//这个为过滤当前部门,加入数据权限后,将由数据权限控制
|
||||
.WhereIF(input.DeptId is not null, x => x.DeptId == input.DeptId)
|
||||
|
||||
.LeftJoin<DeptEntity>((user, dept) => user.DeptId == dept.Id)
|
||||
.Select((user, dept) => new UserGetListOutputDto(), true)
|
||||
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||
|
||||
var result = new PagedResultDto<UserGetListOutputDto>();
|
||||
result.Items = await MapToGetListOutputDtosAsync(entities);
|
||||
result.Items = outPut;
|
||||
result.Total = total;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -123,6 +123,24 @@
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Yi.RBAC.Domain.Identity.AccountManager.UpdatePasswordAsync(System.Int64,System.String,System.String)">
|
||||
<summary>
|
||||
更新密码
|
||||
</summary>
|
||||
<param name="userId"></param>
|
||||
<param name="newPassword"></param>
|
||||
<param name="oldPassword"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:Yi.Framework.Core.Exceptions.UserFriendlyException"></exception>
|
||||
</member>
|
||||
<member name="M:Yi.RBAC.Domain.Identity.AccountManager.RestPasswordAsync(System.Int64,System.String)">
|
||||
<summary>
|
||||
重置密码
|
||||
</summary>
|
||||
<param name="userId"></param>
|
||||
<param name="password"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Domain.Identity.Entities.DeptEntity">
|
||||
<summary>
|
||||
部门表
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using AspNetCore.Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.Options;
|
||||
using StartupModules;
|
||||
using Yi.Framework.AspNetCore;
|
||||
using Yi.Framework.Auth.JwtBearer;
|
||||
using Yi.Framework.Core;
|
||||
using Yi.Framework.Core.Attributes;
|
||||
using Yi.Framework.Core.Autofac;
|
||||
using Yi.Framework.Data.Json;
|
||||
using Yi.RBAC.Application;
|
||||
using Yi.RBAC.Sqlsugar;
|
||||
|
||||
@@ -21,7 +23,11 @@ namespace Yi.RBAC.Web
|
||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||
{
|
||||
//添加控制器与动态api
|
||||
services.AddControllers();
|
||||
services.AddControllers().AddJsonOptions(opt => {
|
||||
|
||||
opt.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss"));
|
||||
|
||||
});
|
||||
services.AddAutoApiService(opt =>
|
||||
{
|
||||
//NETServiceTest所在程序集添加进动态api配置
|
||||
|
||||
Binary file not shown.
@@ -5,6 +5,7 @@ using Yi.Framework.Auth.JwtBearer;
|
||||
using Yi.Framework.Core;
|
||||
using Yi.Framework.Core.Attributes;
|
||||
using Yi.Framework.Core.Autofac;
|
||||
using Yi.Framework.Data.Json;
|
||||
using Yi.Template.Application;
|
||||
using Yi.Template.Sqlsugar;
|
||||
|
||||
@@ -21,7 +22,9 @@ namespace Yi.Template.Web
|
||||
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
||||
{
|
||||
//添加控制器与动态api
|
||||
services.AddControllers();
|
||||
services.AddControllers().AddJsonOptions(opt => {
|
||||
opt.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss"));
|
||||
});
|
||||
services.AddAutoApiService(opt =>
|
||||
{
|
||||
//NETServiceTest所在程序集添加进动态api配置
|
||||
|
||||
Reference in New Issue
Block a user