From fceefac0ee296fa63d00c717889b9a3eee7c07ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Fri, 20 Jan 2023 20:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9E=E5=B8=B8=E4=BC=98=E9=9B=85=E7=9A=84?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=86=E6=95=B0=E6=8D=AE=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extensions/SqlsugarDataFiterExtensions.cs | 37 ++++++++++++++++ .../Extensions/SqlsugarExtensions.cs | 1 - ...ugarDataFiter.cs => SqlsugarDataFilter.cs} | 17 +++++--- .../Yi.Framework.Core.Sqlsugar.csproj | 2 +- .../YiFrameworkCoreSqlsugarModule.cs | 4 +- .../Yi.Framework.Core.csproj | 2 +- .../Extensions/DataFiterExtensions.cs | 41 ++++++++++++++++++ .../Filters/DefaultDataFilter.cs | 9 +++- .../Yi.Framework.Data/Filters/IDataFilter.cs | 2 +- .../YiFrameworkDataModule.cs | 9 ++-- .../ApplicationContractsSwaggerDoc.xml | 5 +++ .../Student/Dtos/StudentGetListOutputDto.cs | 5 +++ .../Student/Dtos/StudentUpdateInputVo.cs | 3 +- .../ApplicationSwaggerDoc.xml | 7 +++ .../Student/StudentService.cs | 30 ++++++++++++- .../YiFrameworkApplicationModule.cs | 4 +- .../Yi.Framework.Domain/DomainSwaggerDoc.xml | 7 ++- .../Student/Entities/StudentEntity.cs | 8 +++- .../IStudentRepository.cs | 4 +- .../Student/StudentManager.cs | 2 +- .../Yi.Framework.Domain.csproj | 1 + .../YiFrameworkDomainModule.cs | 4 +- .../Student/StudentRepository.cs | 2 +- .../YiFrameworkSqlsugarModule.cs | 2 +- .../test/Yi.Framework.Web/TimeTest.txt | 9 ++++ .../test/Yi.Framework.Web/yi-sqlsugar-dev.db | Bin 12288 -> 12288 bytes 26 files changed, 185 insertions(+), 32 deletions(-) create mode 100644 Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarDataFiterExtensions.cs rename Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Filters/{SqlsugarDataFiter.cs => SqlsugarDataFilter.cs} (73%) create mode 100644 Yi.Framework.Net6/src/framework/Yi.Framework.Data/Extensions/DataFiterExtensions.cs rename Yi.Framework.Net6/test/Yi.Framework.Domain/Student/{IRepository => Repositories}/IStudentRepository.cs (73%) diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarDataFiterExtensions.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarDataFiterExtensions.cs new file mode 100644 index 00000000..e6a96ce3 --- /dev/null +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarDataFiterExtensions.cs @@ -0,0 +1,37 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Core.Sqlsugar.Extensions +{ + public static class SqlsugarDataFilterExtensions + { + public static IApplicationBuilder UseSqlsugarDataFiterServer(this IApplicationBuilder builder) + { + return builder.UseMiddleware(); + } + } + + public class SqlsugarDataFilterMiddleware + { + private readonly RequestDelegate _next; + private readonly ILogger _logger; + public SqlsugarDataFilterMiddleware(RequestDelegate next, ILoggerFactory loggerFactory) + { + this._next = next; + this._logger = loggerFactory.CreateLogger(); + } + public async Task InvokeAsync(HttpContext context) + { + + await _next(context); + + } + } + +} \ No newline at end of file diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarExtensions.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarExtensions.cs index 587310c7..12da5a19 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarExtensions.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarExtensions.cs @@ -81,7 +81,6 @@ namespace Yi.Framework.Core.Sqlsugar.Extensions { action(db); } - db.Aop.DataExecuting = (oldValue, entityInfo) => { diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Filters/SqlsugarDataFiter.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Filters/SqlsugarDataFilter.cs similarity index 73% rename from Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Filters/SqlsugarDataFiter.cs rename to Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Filters/SqlsugarDataFilter.cs index f3ee5479..f01082d4 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Filters/SqlsugarDataFiter.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Filters/SqlsugarDataFilter.cs @@ -9,10 +9,10 @@ using Yi.Framework.Data.Filters; namespace Yi.Framework.Core.Sqlsugar.Filters { - public class SqlsugarDataFiter : IDataFilter + public class SqlsugarDataFilter : IDataFilter { private ISqlSugarClient _Db { get; set; } - public SqlsugarDataFiter(ISqlSugarClient sqlSugarClient) + public SqlsugarDataFilter(ISqlSugarClient sqlSugarClient) { _Db = sqlSugarClient; } @@ -24,24 +24,27 @@ namespace Yi.Framework.Core.Sqlsugar.Filters public IDisposable Disable() where TFilter : class { _Db.QueryFilter.ClearAndBackup(); - throw new NotImplementedException(); + return this; } public IDisposable Enable() where TFilter : class { - _Db.QueryFilter.Restore(); - throw new NotImplementedException(); + throw new NotImplementedException("暂时没有单独还原过滤器的方式"); } public bool IsEnabled() where TFilter : class { - throw new NotImplementedException(); + throw new NotImplementedException("暂时没有判断过滤器的方式"); } public void RemoveFilter() where TFilter : class { _Db.QueryFilter.Clear(); - throw new NotImplementedException(); + } + + public void Dispose() + { + _Db.QueryFilter.Restore(); } } } diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Yi.Framework.Core.Sqlsugar.csproj b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Yi.Framework.Core.Sqlsugar.csproj index 1276c02d..42b58aee 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Yi.Framework.Core.Sqlsugar.csproj +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Yi.Framework.Core.Sqlsugar.csproj @@ -7,7 +7,7 @@ - + diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs index d7c12efd..5349b2b2 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/YiFrameworkCoreSqlsugarModule.cs @@ -3,9 +3,11 @@ using Microsoft.Extensions.DependencyInjection; using StartupModules; using Yi.Framework.Core.Configuration; using Yi.Framework.Core.Sqlsugar.Extensions; +using Yi.Framework.Core.Sqlsugar.Filters; using Yi.Framework.Core.Sqlsugar.Options; using Yi.Framework.Core.Sqlsugar.Repositories; using Yi.Framework.Core.Sqlsugar.Uow; +using Yi.Framework.Data.Filters; using Yi.Framework.Ddd; using Yi.Framework.Ddd.Repositories; using Yi.Framework.Uow; @@ -26,7 +28,7 @@ namespace Yi.Framework.Core.Sqlsugar services.AddSingleton(); //这里替换过滤器实现 - + services.AddScoped(); services.Configure(Appsettings.appConfiguration("DbConnOptions")); services.AddSqlsugarServer(); diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core/Yi.Framework.Core.csproj b/Yi.Framework.Net6/src/framework/Yi.Framework.Core/Yi.Framework.Core.csproj index 0747ddde..f7eab964 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core/Yi.Framework.Core.csproj +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core/Yi.Framework.Core.csproj @@ -12,7 +12,7 @@ - + diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Data/Extensions/DataFiterExtensions.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Data/Extensions/DataFiterExtensions.cs new file mode 100644 index 00000000..ba4a8788 --- /dev/null +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Data/Extensions/DataFiterExtensions.cs @@ -0,0 +1,41 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Data.Entities; +using Yi.Framework.Data.Filters; + +namespace Yi.Framework.Data.Extensions +{ + public static class DataFilterExtensions + { + public static IApplicationBuilder UseDataFiterServer(this IApplicationBuilder builder) + { + return builder.UseMiddleware(); + } + } + + public class DataFilterMiddleware + { + private readonly RequestDelegate _next; + private readonly ILogger _logger; + public DataFilterMiddleware(RequestDelegate next, ILoggerFactory loggerFactory) + { + this._next = next; + this._logger = loggerFactory.CreateLogger(); + } + public async Task InvokeAsync(HttpContext context, IDataFilter dataFilter) + { + //添加默认的过滤器 + dataFilter.AddFilter(u => u.IsDeleted == false); + //dataFilter.AddFilter(u => u.TenantId == Guid.Empty); + await _next(context); + + } + } + +} \ No newline at end of file diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Data/Filters/DefaultDataFilter.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Data/Filters/DefaultDataFilter.cs index eaffb534..9731b2d9 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Data/Filters/DefaultDataFilter.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Data/Filters/DefaultDataFilter.cs @@ -21,12 +21,12 @@ namespace Yi.Framework.Data.Filters public IDisposable Disable() where TFilter : class { - return null; + return this; } public IDisposable Enable() where TFilter : class { - return null; + return this; } public bool IsEnabled() where TFilter : class @@ -44,5 +44,10 @@ namespace Yi.Framework.Data.Filters public void AddFilter(Expression> expression) where TFilter : class { } + + public void Dispose() + { + + } } } diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Data/Filters/IDataFilter.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Data/Filters/IDataFilter.cs index 7a0bc8de..94834627 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Data/Filters/IDataFilter.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Data/Filters/IDataFilter.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace Yi.Framework.Data.Filters { - public interface IDataFilter + public interface IDataFilter:IDisposable { IDisposable Enable() where TFilter :class; diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Data/YiFrameworkDataModule.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Data/YiFrameworkDataModule.cs index cade1dae..b46ce65d 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Data/YiFrameworkDataModule.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Data/YiFrameworkDataModule.cs @@ -8,6 +8,7 @@ using System.Text; using System.Threading.Tasks; using Yi.Framework.Core.Attributes; using Yi.Framework.Data.Entities; +using Yi.Framework.Data.Extensions; using Yi.Framework.Data.Filters; using Yi.Framework.Ddd; @@ -19,12 +20,8 @@ namespace Yi.Framework.Data { public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context) { - var dataFilter = app.ApplicationServices.GetRequiredService(); - //内置多租户与软删除过滤 - dataFilter.AddFilter(u => u.IsDeleted == false); - - //租户id从租户管理中获取 - dataFilter.AddFilter(u => u.TenantId == Guid.Empty); + //使用了过滤器 + app.UseDataFiterServer(); } public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context) diff --git a/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/ApplicationContractsSwaggerDoc.xml b/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/ApplicationContractsSwaggerDoc.xml index 11e2c951..86c22a7e 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/ApplicationContractsSwaggerDoc.xml +++ b/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/ApplicationContractsSwaggerDoc.xml @@ -9,6 +9,11 @@ Student输入创建对象 + + + 想看一下结果 + + 服务抽象 diff --git a/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetListOutputDto.cs b/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetListOutputDto.cs index 038089fc..e411d13e 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetListOutputDto.cs +++ b/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetListOutputDto.cs @@ -12,5 +12,10 @@ namespace Yi.Framework.Application.Contracts.Student.Dtos public long Id { get; set; } public string Name { get; set; } public long Number { get; set; } + + /// + /// 想看一下结果 + /// + public bool IsDeleted { get; set; } } } diff --git a/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/Student/Dtos/StudentUpdateInputVo.cs b/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/Student/Dtos/StudentUpdateInputVo.cs index 6d08896e..1f6faca7 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/Student/Dtos/StudentUpdateInputVo.cs +++ b/Yi.Framework.Net6/test/Yi.Framework.Application.Contracts/Student/Dtos/StudentUpdateInputVo.cs @@ -8,9 +8,10 @@ namespace Yi.Framework.Application.Contracts.Student.Dtos { public class StudentUpdateInputVo { - public long Id { get; set; } public string? Name { get; set; } public long? Number { get; set; } + + public bool IsDeleted { get; set; } } } diff --git a/Yi.Framework.Net6/test/Yi.Framework.Application/ApplicationSwaggerDoc.xml b/Yi.Framework.Net6/test/Yi.Framework.Application/ApplicationSwaggerDoc.xml index 89050e60..150046e4 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Application/ApplicationSwaggerDoc.xml +++ b/Yi.Framework.Net6/test/Yi.Framework.Application/ApplicationSwaggerDoc.xml @@ -9,6 +9,13 @@ 服务实现 + + + 数据过滤测试 + + + + 测试token diff --git a/Yi.Framework.Net6/test/Yi.Framework.Application/Student/StudentService.cs b/Yi.Framework.Net6/test/Yi.Framework.Application/Student/StudentService.cs index cd408c39..b139b05c 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Application/Student/StudentService.cs +++ b/Yi.Framework.Net6/test/Yi.Framework.Application/Student/StudentService.cs @@ -5,7 +5,6 @@ using System.Text; using System.Threading.Tasks; using Yi.Framework.Application.Contracts.Student; using Yi.Framework.Domain.Student; -using Yi.Framework.Domain.Student.IRepository; using Microsoft.AspNetCore.Mvc; using NET.AutoWebApi.Setting; using Microsoft.AspNetCore.Http; @@ -21,6 +20,10 @@ using Yi.Framework.Core.Const; using Yi.Framework.Core.CurrentUsers; using Yi.Framework.Auth.JwtBearer.Authorization; using Yi.Framework.Domain.Shared.Student.ConstClasses; +using Yi.Framework.Domain.Student.Repositories; +using Yi.Framework.Data.Filters; +using Yi.Framework.Data.Entities; +using Yi.Framework.Ddd.Dtos; namespace Yi.Framework.Application.Student { @@ -37,13 +40,36 @@ namespace Yi.Framework.Application.Student private readonly IUnitOfWorkManager _unitOfWorkManager; private readonly JwtTokenManager _jwtTokenManager; private readonly ICurrentUser _currentUser; - public StudentService(IStudentRepository studentRepository, StudentManager studentManager, IUnitOfWorkManager unitOfWorkManager, JwtTokenManager jwtTokenManager, ICurrentUser currentUser) + private readonly IDataFilter _dataFilter; + public StudentService(IStudentRepository studentRepository, StudentManager studentManager, IUnitOfWorkManager unitOfWorkManager, JwtTokenManager jwtTokenManager, ICurrentUser currentUser, IDataFilter dataFilter) { _studentRepository = studentRepository; _studentManager = studentManager; _unitOfWorkManager = unitOfWorkManager; _jwtTokenManager = jwtTokenManager; _currentUser = currentUser; + _dataFilter = dataFilter; + } + + /// + /// 数据过滤测试 + /// + /// + /// + public async Task> GetDataFiterTestAsync(StudentGetListInputVo input) + { + PagedResultDto res = new(); + using (_dataFilter.Disable()) + { + + res = await base.GetListAsync(input); + + + } + + var p = await base.GetListAsync(input); + return res; + } /// diff --git a/Yi.Framework.Net6/test/Yi.Framework.Application/YiFrameworkApplicationModule.cs b/Yi.Framework.Net6/test/Yi.Framework.Application/YiFrameworkApplicationModule.cs index f1779cf9..886ac2db 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Application/YiFrameworkApplicationModule.cs +++ b/Yi.Framework.Net6/test/Yi.Framework.Application/YiFrameworkApplicationModule.cs @@ -11,6 +11,8 @@ using Yi.Framework.Application.Contracts.Student; using Yi.Framework.Application.Student; using Yi.Framework.Auth.JwtBearer; using Yi.Framework.Core.Attributes; +using Yi.Framework.Data; +using Yi.Framework.Ddd; using Yi.Framework.Domain; namespace Yi.Framework.Application @@ -18,7 +20,7 @@ namespace Yi.Framework.Application [DependsOn( typeof(YiFrameworkApplicationContractsModule), typeof(YiFrameworkDomainModule), - typeof(YiFrameworkAuthJwtBearerModule) + typeof(YiFrameworkAuthJwtBearerModule) )] public class YiFrameworkApplicationModule : IStartupModule { diff --git a/Yi.Framework.Net6/test/Yi.Framework.Domain/DomainSwaggerDoc.xml b/Yi.Framework.Net6/test/Yi.Framework.Domain/DomainSwaggerDoc.xml index 58ec9d8d..2c280732 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Domain/DomainSwaggerDoc.xml +++ b/Yi.Framework.Net6/test/Yi.Framework.Domain/DomainSwaggerDoc.xml @@ -19,7 +19,12 @@ 学号 - + + + 软删除 + + + 仓储抽象 diff --git a/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/Entities/StudentEntity.cs b/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/Entities/StudentEntity.cs index 77041083..dc43ae7d 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/Entities/StudentEntity.cs +++ b/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/Entities/StudentEntity.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Yi.Framework.Data.Entities; using Yi.Framework.Ddd.Entities; namespace Yi.Framework.Domain.Student.Entities @@ -12,7 +13,7 @@ namespace Yi.Framework.Domain.Student.Entities /// 学生实体 /// [SugarTable("Student")] - public class StudentEntity : IEntity + public class StudentEntity : IEntity, ISoftDelete { [SugarColumn(IsPrimaryKey = true)] public long Id { get; set; } @@ -26,5 +27,10 @@ namespace Yi.Framework.Domain.Student.Entities /// 学号 /// public long Number { get;set ; } + + /// + /// 软删除 + /// + public bool IsDeleted { get; set; } } } diff --git a/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/IRepository/IStudentRepository.cs b/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/Repositories/IStudentRepository.cs similarity index 73% rename from Yi.Framework.Net6/test/Yi.Framework.Domain/Student/IRepository/IStudentRepository.cs rename to Yi.Framework.Net6/test/Yi.Framework.Domain/Student/Repositories/IStudentRepository.cs index b5ad134a..9b0c4440 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/IRepository/IStudentRepository.cs +++ b/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/Repositories/IStudentRepository.cs @@ -6,12 +6,12 @@ using System.Threading.Tasks; using Yi.Framework.Ddd.Repositories; using Yi.Framework.Domain.Student.Entities; -namespace Yi.Framework.Domain.Student.IRepository +namespace Yi.Framework.Domain.Student.Repositories { /// /// 仓储抽象 /// - public interface IStudentRepository:IRepository + public interface IStudentRepository : IRepository { Task> GetMyListAsync(); } diff --git a/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/StudentManager.cs b/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/StudentManager.cs index ab48018c..cf689add 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/StudentManager.cs +++ b/Yi.Framework.Net6/test/Yi.Framework.Domain/Student/StudentManager.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Domain.Student.IRepository; +using Yi.Framework.Domain.Student.Repositories; namespace Yi.Framework.Domain.Student { diff --git a/Yi.Framework.Net6/test/Yi.Framework.Domain/Yi.Framework.Domain.csproj b/Yi.Framework.Net6/test/Yi.Framework.Domain/Yi.Framework.Domain.csproj index 539b5685..b7b74ac3 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Domain/Yi.Framework.Domain.csproj +++ b/Yi.Framework.Net6/test/Yi.Framework.Domain/Yi.Framework.Domain.csproj @@ -11,6 +11,7 @@ + diff --git a/Yi.Framework.Net6/test/Yi.Framework.Domain/YiFrameworkDomainModule.cs b/Yi.Framework.Net6/test/Yi.Framework.Domain/YiFrameworkDomainModule.cs index 40eab39a..108a08e0 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Domain/YiFrameworkDomainModule.cs +++ b/Yi.Framework.Net6/test/Yi.Framework.Domain/YiFrameworkDomainModule.cs @@ -7,13 +7,15 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Yi.Framework.Core.Attributes; +using Yi.Framework.Data; using Yi.Framework.Domain.Shared; using Yi.Framework.Domain.Student; namespace Yi.Framework.Domain { [DependsOn( - typeof(YiFrameworkDomainSharedModule) + typeof(YiFrameworkDomainSharedModule), + typeof(YiFrameworkDataModule) )] public class YiFrameworkDomainModule : IStartupModule { diff --git a/Yi.Framework.Net6/test/Yi.Framework.Sqlsugar/Student/StudentRepository.cs b/Yi.Framework.Net6/test/Yi.Framework.Sqlsugar/Student/StudentRepository.cs index 49865788..c29bf1c8 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Sqlsugar/Student/StudentRepository.cs +++ b/Yi.Framework.Net6/test/Yi.Framework.Sqlsugar/Student/StudentRepository.cs @@ -6,7 +6,7 @@ using System.Text; using System.Threading.Tasks; using Yi.Framework.Core.Sqlsugar.Repositories; using Yi.Framework.Domain.Student.Entities; -using Yi.Framework.Domain.Student.IRepository; +using Yi.Framework.Domain.Student.Repositories; namespace Yi.Framework.Sqlsugar.Student { diff --git a/Yi.Framework.Net6/test/Yi.Framework.Sqlsugar/YiFrameworkSqlsugarModule.cs b/Yi.Framework.Net6/test/Yi.Framework.Sqlsugar/YiFrameworkSqlsugarModule.cs index 68cc8bc9..27ed4df1 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Sqlsugar/YiFrameworkSqlsugarModule.cs +++ b/Yi.Framework.Net6/test/Yi.Framework.Sqlsugar/YiFrameworkSqlsugarModule.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; using Yi.Framework.Core.Attributes; using Yi.Framework.Core.Sqlsugar; using Yi.Framework.Domain; -using Yi.Framework.Domain.Student.IRepository; +using Yi.Framework.Domain.Student.Repositories; using Yi.Framework.Sqlsugar.Student; namespace Yi.Framework.Sqlsugar diff --git a/Yi.Framework.Net6/test/Yi.Framework.Web/TimeTest.txt b/Yi.Framework.Net6/test/Yi.Framework.Web/TimeTest.txt index 3d525b22..5fee3a46 100644 --- a/Yi.Framework.Net6/test/Yi.Framework.Web/TimeTest.txt +++ b/Yi.Framework.Net6/test/Yi.Framework.Web/TimeTest.txt @@ -65,3 +65,12 @@ 2023:01:19-17:52:49本次运行启动时间为:1940毫秒 2023:01:19-17:54:41本次运行启动时间为:1861毫秒 2023:01:19-17:57:37本次运行启动时间为:1945毫秒 +2023:01:20-18:25:59本次运行启动时间为:43382毫秒 +2023:01:20-18:29:09本次运行启动时间为:2173毫秒 +2023:01:20-18:32:14本次运行启动时间为:2397毫秒 +2023:01:20-18:34:14本次运行启动时间为:2126毫秒 +2023:01:20-18:38:36本次运行启动时间为:2152毫秒 +2023:01:20-18:45:15本次运行启动时间为:7203毫秒 +2023:01:20-18:50:46本次运行启动时间为:6513毫秒 +2023:01:20-18:53:16本次运行启动时间为:5186毫秒 +2023:01:20-19:01:36本次运行启动时间为:5194毫秒 diff --git a/Yi.Framework.Net6/test/Yi.Framework.Web/yi-sqlsugar-dev.db b/Yi.Framework.Net6/test/Yi.Framework.Web/yi-sqlsugar-dev.db index b0514e4f9fef1e7084b03979f345c664058bc6e4..087c98f885b1d9d9c1a8d0078f98ce87e78c1627 100644 GIT binary patch delta 139 zcmZojXh@hK&B#1a##xY=LC<{!FaHk)CVpWCeqsKT8w(fnaWxtEt-_zN%xwse@7#R7#Fz|nYDAZ=;;bvxos{#NuD<+u$ literal 12288 zcmeI0U1%It7=~welg-b}oRc=&Y?5u8$u_^uMrLPrW_A^e*%E4Ll4_EoMM~V5RTJ`q z+l>^9KMjbAr3jh}TZ1AhdZD&PTd65FDN%A!1hEAL+Y6hfnqE{CQAF{av){oJyy%S= z3TI&0edn3)JKwxByD)Fx-Ce`^tnuJPZY+~GY^6f+`II{hLs67=vIoe{Hy`;@#0B}J z`es|Za?6glb^NR1$EJc!ymYey$)y9*0qKBrKsq2DkPb)(qyy3c>40=VI`Cg`;82yX zBpiwOrULoQ;ApllKRJ{g&%=j*dv9k)f2Yykk?!g=qHr|YqL)W^4n>W@;fIFD^G46^ zexqkkSC?^D@6PUy-o3`I&b>yAoYRvT%SMeyGr0#I&g5Dw(`^0w+`!PV$@bP3I)H_$U^1a%`5RqDU!U+Z)FtNN6l)$i2Xbfo>LeWjh!j%tr<_iNj= zCap}pu706@piZj?)ce$Jq_Nzj1JVKMfOJ4QARUknNC%_?|0f3`v7%tJziO=F)NHy! zx%Skdt24)!UwqR_CG3)wNE?T>B6O3MN#It1CvQv%l}_AA5ZKD$l3#$f<5Aecp|K!9 zH<_Sqn*n|lUIVR!LtqoY56_9vN+xM#BZse~g|>0qq_Ba*QL!?WU~mh-*~@;R()R2m zsf=>iCsroou1jD&z!R$?v^|$r8XP`7CA3Ys9))!rwu);yDbFKtGr;3Hu`=m;^innf zd~Z>#G~JX%;Kl;PpMNV>dZwKsFaq$il{GM)qBpx1;KJbrVOq;I=|D9c?hz|V*EoUI z0O$V{E6F@`+AxRHVx{Gobf7ALXKfLBNoM>8fSLKUFp%k)^g2TYSbXp{aZRtVW+lMT z1+i_?jnjeFGdNoM*gmnXo$~1YT*u(ZPw6varEA&LgbIMS?-$p!%p`p@F~Ih7V%vCv znSeO#S<}{IzZD%|?4n<|PI6P|v>Jy)BJ{|!NuUa_?Y!7FZaZ|Kat`lV5ZbzKf*M~2 zurVjLbuEXQPztbNp9q~eTeAdUbVh`p<Q4@XZvLC(E8b7cA0G38RF zj~w-p4kt!P`{lXUu6+F5L^=5{j_HdE{u!^}Z}5417SH0h@XI6zcoOGu7T=3^;cYmM z8*mtxqd(9M^c}j0me3q}AH9yI(X;3v8b=w_k9MG2Q9CkFB?{`l>DTqk`j@1!+@u52 z0qKBrKsq2DkPb)(qyy3c>40?L-*Z3<1bsZAig7^`sWuQSf!fLiO`KY}pb1k82$m={ zgJ20#6BjfwYUF|@L=7NVBD94IngB&Xu*9dH3!3m4T+l?P4g^bZHiKY^&8C7VBs3dA zutX*Tf+aAuT+qa&1_Vo3s=1(vN*Dx7P^v(%#AHK36cUmU2$qOcG64z5dL|(8SO