diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarCodeFirstExtensions.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarCodeFirstExtensions.cs index 4210b894..8c98fee9 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarCodeFirstExtensions.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Extensions/SqlsugarCodeFirstExtensions.cs @@ -19,6 +19,8 @@ namespace Yi.Framework.Core.Sqlsugar.Extensions var db = app.ApplicationServices.GetRequiredService(); var options = app.ApplicationServices.GetRequiredService>(); + //if (options.Value.EnabledCodeFirst == false) return; + var assemblys = new List(); //全盘加载 diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Repositories/SqlsugarRepository.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Repositories/SqlsugarRepository.cs index eb50b0f2..2d04b21d 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Repositories/SqlsugarRepository.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Core.Sqlsugar/Repositories/SqlsugarRepository.cs @@ -16,7 +16,7 @@ using Yi.Framework.Ddd.Repositories; namespace Yi.Framework.Core.Sqlsugar.Repositories { [AppService(ServiceType = typeof(IRepository<>))] - public class SqlsugarRepository : SimpleClient, IRepository where T : class, IEntity, new() + public class SqlsugarRepository : SimpleClient, IRepository where T : class, new() { public SqlsugarRepository(ISqlSugarClient context) : base(context) { 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 5349b2b2..e13674bb 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 @@ -29,6 +29,7 @@ namespace Yi.Framework.Core.Sqlsugar //这里替换过滤器实现 services.AddScoped(); + var ss= Appsettings.appConfiguration("DbConnOptions", "EnabledCodeFirst"); services.Configure(Appsettings.appConfiguration("DbConnOptions")); services.AddSqlsugarServer(); diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Repositories/IRepository.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Repositories/IRepository.cs index 2cb91d0f..d744ce94 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Repositories/IRepository.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Repositories/IRepository.cs @@ -10,7 +10,7 @@ using Yi.Framework.Ddd.Entities; namespace Yi.Framework.Ddd.Repositories { - public interface IRepository where T : class, IEntity, new() + public interface IRepository { //单查 Task GetByIdAsync(dynamic id); diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ReadOnlyAppService.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ReadOnlyAppService.cs index 0a9d73bf..0ff2b834 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ReadOnlyAppService.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Services/ReadOnlyAppService.cs @@ -75,7 +75,7 @@ where TEntityDto : IEntityDto } /// - /// 全查 + /// 多查 /// /// /// diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml index 56826b88..390a19a0 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml @@ -43,7 +43,7 @@ - 全查 + 多查 diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/AbstractTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/AbstractTemplateProvider.cs similarity index 95% rename from Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/AbstractTemplateProvider.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/AbstractTemplateProvider.cs index 0826a7a8..cf35c614 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/AbstractTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/AbstractTemplateProvider.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Yi.Framework.Template.Abstracts +namespace Yi.Framework.Template.Abstract { public abstract class AbstractTemplateProvider : ITemplateProvider { diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/ITemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/ITemplateProvider.cs similarity index 94% rename from Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/ITemplateProvider.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/ITemplateProvider.cs index bffe55a5..5ac81801 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/ITemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/ITemplateProvider.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Yi.Framework.Template.Abstracts +namespace Yi.Framework.Template.Abstract { public interface ITemplateProvider { diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/ModelTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/ModelTemplateProvider.cs similarity index 87% rename from Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/ModelTemplateProvider.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/ModelTemplateProvider.cs index e03e3b4a..7778f0df 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/ModelTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/ModelTemplateProvider.cs @@ -5,14 +5,14 @@ using System.Text; using System.Threading.Tasks; using Yi.Framework.Template.ConstClasses; -namespace Yi.Framework.Template.Abstracts +namespace Yi.Framework.Template.Abstract { public abstract class ModelTemplateProvider : ProgramTemplateProvider { public ModelTemplateProvider(string modelName, string entityName) : base(modelName, entityName) { - AddIgnoreEntityField("Id", "TenantId"); + AddIgnoreEntityField(/*"Id", */"TenantId", "IsDeleted"); } private string entityPath=string.Empty; @@ -59,19 +59,27 @@ namespace Yi.Framework.Template.Abstracts continue; } //是字段属性,同时还包含忽略字段 + bool IsSkip = false; + foreach (var IgnoreEntityField in IgnoreEntityFields) { if (enetityDatas[i].Contains(IgnoreEntityField)) { enetityDatas.RemoveAt(i); - continue; + IsSkip=true; + break;; } } - //以}结尾,不包含get不是属性,代表类结尾 - if (enetityDatas[i].EndsWith("}") && !enetityDatas[i].Contains("get")) + + if (!IsSkip) { - break; + //以}结尾,不包含get不是属性,代表类结尾 + if (enetityDatas[i].EndsWith("}") && !enetityDatas[i].Contains("get")) + { + break; + } } + } //拼接实体字段 diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/ProgramTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/ProgramTemplateProvider.cs similarity index 98% rename from Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/ProgramTemplateProvider.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/ProgramTemplateProvider.cs index 351f8f01..8fda0ffb 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstracts/ProgramTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Abstract/ProgramTemplateProvider.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using Yi.Framework.Template.ConstClasses; -namespace Yi.Framework.Template.Abstracts +namespace Yi.Framework.Template.Abstract { public abstract class ProgramTemplateProvider : AbstractTemplateProvider diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/ConstClasses/TemplateConst.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/ConstClasses/TemplateConst.cs index 5adc849d..d051e35b 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/ConstClasses/TemplateConst.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/ConstClasses/TemplateConst.cs @@ -33,6 +33,10 @@ namespace Yi.Framework.Template.ConstClasses /// public const string EntityField = "#EntityField#"; - public const string BuildRootPath = ""; + //public const string BuildRootPath = "../../../_Code"; + + + public const string BuildRootPath = "../../../../../project"; + public const string BuildEntityPath = "../../../../../project"; } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs index cfef074f..ebddc907 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs @@ -6,8 +6,8 @@ TemplateFactory templateFactory = new(); //选择需要生成的模板提供者 -string modelName = ""; -List entityNames = new() { "_" }; +string modelName = "School"; +List entityNames = new() { "Student" }; foreach (var entityName in entityNames) { @@ -16,17 +16,17 @@ foreach (var entityName in entityNames) option.Add(new ServiceTemplateProvider(modelName, entityName)); option.Add(new IServiceTemplateProvider(modelName, entityName)); - option.Add(new CreateInputVoTemplateProvider(modelName, entityName)); option.Add(new UpdateInputVoTemplateProvider(modelName, entityName)); option.Add(new GetListInputVoTemplateProvider(modelName, entityName)); option.Add(new GetListOutputDtoTemplateProvider(modelName, entityName)); + option.Add(new GetOutputDtoTemplateProvider(modelName, entityName)); option.Add(new ConstTemplateProvider(modelName, entityName)); option.Add(new ProfileTemplateProvider(modelName, entityName)); - option.Add(new ApiTemplateProvider(modelName, entityName)); + //option.Add(new ApiTemplateProvider(modelName, entityName)); }); //开始构建模板 templateFactory.BuildTemplate(); diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ConstTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ConstTemplateProvider.cs index 1b6aaddb..f992ecf2 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ConstTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ConstTemplateProvider.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Template.Abstracts; +using Yi.Framework.Template.Abstract; using Yi.Framework.Template.ConstClasses; namespace Yi.Framework.Template.Provider.Server @@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server { public ConstTemplateProvider(string modelName, string entityName) : base(modelName, entityName) { - BuildPath = $@"..\..\..\..\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\ConstConfig\{TemplateConst.EntityName}Const.cs"; + BuildPath = $@"{TemplateConst.BuildRootPath}\Yi.Framework.Domain.Shared\{TemplateConst.ModelName}\ConstClasses\{TemplateConst.EntityName}Const.cs"; TemplatePath = $@"..\..\..\Template\Server\ConstTemplate.txt"; } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/CreateInputVoTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/CreateInputVoTemplateProvider.cs index 4969ea62..26b95c5f 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/CreateInputVoTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/CreateInputVoTemplateProvider.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Template.Abstracts; +using Yi.Framework.Template.Abstract; using Yi.Framework.Template.ConstClasses; namespace Yi.Framework.Template.Provider.Server @@ -12,9 +12,9 @@ namespace Yi.Framework.Template.Provider.Server { public CreateInputVoTemplateProvider(string modelName, string entityName) : base(modelName, entityName) { - BuildPath = $@"..\..\..\..\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\{TemplateConst.EntityName}CreateInput.cs"; - TemplatePath = $@"..\..\..\Template\Server\CreateInputTemplate.txt"; - EntityPath = $@"..\..\..\..\Yi.Framework.Model\{TemplateConst.ModelName}\Entitys\{TemplateConst.EntityName}Entity.cs"; + BuildPath = $@"{TemplateConst.BuildRootPath}\Yi.Framework.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}CreateInputVo.cs"; + TemplatePath = $@"..\..\..\Template\Server\CreateInputVoTemplate.txt"; + EntityPath = $@"{TemplateConst.BuildEntityPath}\Yi.Framework.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs"; } } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetListInputVoTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetListInputVoTemplateProvider.cs index b7d2d169..d984e14f 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetListInputVoTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetListInputVoTemplateProvider.cs @@ -3,18 +3,18 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Template.Abstracts; +using Yi.Framework.Template.Abstract; using Yi.Framework.Template.ConstClasses; namespace Yi.Framework.Template.Provider.Server { - public class GetListInputTemplateProvider : ModelTemplateProvider + public class GetListInputVoTemplateProvider : ModelTemplateProvider { - public GetListInputTemplateProvider(string modelName, string entityName) : base(modelName, entityName) + public GetListInputVoTemplateProvider(string modelName, string entityName) : base(modelName, entityName) { - BuildPath = $@"..\..\..\..\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\{TemplateConst.EntityName}GetListInput.cs"; - TemplatePath = $@"..\..\..\Template\Server\GetListInputTemplate.txt"; - EntityPath = $@"..\..\..\..\Yi.Framework.Model\{TemplateConst.ModelName}\Entitys\{TemplateConst.EntityName}Entity.cs"; + BuildPath = $@"{TemplateConst.BuildRootPath}\Yi.Framework.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}GetListInputVo.cs"; + TemplatePath = $@"..\..\..\Template\Server\GetListInputVoTemplate.txt"; + EntityPath = $@"{TemplateConst.BuildEntityPath}\Yi.Framework.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs"; } } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetListOutputDtoTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetListOutputDtoTemplateProvider.cs index 6ca9dc5c..85abe13f 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetListOutputDtoTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetListOutputDtoTemplateProvider.cs @@ -3,18 +3,18 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Template.Abstracts; +using Yi.Framework.Template.Abstract; using Yi.Framework.Template.ConstClasses; namespace Yi.Framework.Template.Provider.Server { - public class GetListOutputTemplateProvider : ModelTemplateProvider + public class GetListOutputDtoTemplateProvider : ModelTemplateProvider { - public GetListOutputTemplateProvider(string modelName, string entityName) : base(modelName, entityName) + public GetListOutputDtoTemplateProvider(string modelName, string entityName) : base(modelName, entityName) { - BuildPath = $@"..\..\..\..\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\{TemplateConst.EntityName}GetListOutput.cs"; - TemplatePath = $@"..\..\..\Template\Server\GetListOutputTemplate.txt"; - EntityPath = $@"..\..\..\..\Yi.Framework.Model\{TemplateConst.ModelName}\Entitys\{TemplateConst.EntityName}Entity.cs"; + BuildPath = $@"{TemplateConst.BuildRootPath}\Yi.Framework.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}GetListOutputDto.cs"; + TemplatePath = $@"..\..\..\Template\Server\GetListOutputDtoTemplate.txt"; + EntityPath = $@"{TemplateConst.BuildEntityPath}\Yi.Framework.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs"; } } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetOutputDtoTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetOutputDtoTemplateProvider.cs index 259e99b5..132aa350 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetOutputDtoTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/GetOutputDtoTemplateProvider.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Template.Abstracts; +using Yi.Framework.Template.Abstract; using Yi.Framework.Template.ConstClasses; namespace Yi.Framework.Template.Provider.Server @@ -12,9 +12,9 @@ namespace Yi.Framework.Template.Provider.Server { public GetOutputDtoTemplateProvider(string modelName, string entityName) : base(modelName, entityName) { - BuildPath = $@"..\..\..\..\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\{TemplateConst.EntityName}GetOutputDto.cs"; + BuildPath = $@"{TemplateConst.BuildRootPath}\Yi.Framework.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}\{TemplateConst.EntityName}GetOutputDto.cs"; TemplatePath = $@"..\..\..\Template\Server\GetOutputDtoTemplate.txt"; - EntityPath = $@"..\..\..\..\Yi.Framework.Model\{TemplateConst.ModelName}\Entitys\{TemplateConst.EntityName}Entity.cs"; + EntityPath = $@"{TemplateConst.BuildEntityPath}\Yi.Framework.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs"; } } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/IServiceTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/IServiceTemplateProvider.cs index 31799ced..20dd051a 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/IServiceTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/IServiceTemplateProvider.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Template.Abstracts; +using Yi.Framework.Template.Abstract; using Yi.Framework.Template.ConstClasses; namespace Yi.Framework.Template.Provider.Server @@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server { public IServiceTemplateProvider(string modelName, string entityName) : base(modelName, entityName) { - BuildPath = $@"..\..\..\..\Yi.Framework.Interface\{TemplateConst.ModelName}\I{TemplateConst.EntityName}Service.cs"; + BuildPath = $@"{TemplateConst.BuildRootPath}\Yi.Framework.Application.Contracts\{TemplateConst.ModelName}\I{TemplateConst.EntityName}Service.cs"; TemplatePath = $@"..\..\..\Template\Server\IServiceTemplate.txt"; } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ProfileTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ProfileTemplateProvider.cs index 074b3803..cb4e484f 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ProfileTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ProfileTemplateProvider.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Template.Abstracts; +using Yi.Framework.Template.Abstract; using Yi.Framework.Template.ConstClasses; namespace Yi.Framework.Template.Provider.Server @@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server { public ProfileTemplateProvider(string modelName, string entityName) : base(modelName, entityName) { - BuildPath = $@"..\..\..\..\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\MapperConfig\{TemplateConst.EntityName}Profile.cs"; + BuildPath = $@"{TemplateConst.BuildRootPath}\Yi.Framework.Application\{TemplateConst.ModelName}\MapperConfig\{TemplateConst.EntityName}Profile.cs"; TemplatePath = $@"..\..\..\Template\Server\ProfileTemplate.txt"; } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ServiceTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ServiceTemplateProvider.cs index 6121b10a..ddb511ec 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ServiceTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/ServiceTemplateProvider.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Template.Abstracts; +using Yi.Framework.Template.Abstract; using Yi.Framework.Template.ConstClasses; namespace Yi.Framework.Template.Provider.Server @@ -12,7 +12,7 @@ namespace Yi.Framework.Template.Provider.Server { public ServiceTemplateProvider(string modelName, string entityName) : base(modelName, entityName) { - BuildPath = $@"..\..\..\..\Yi.Framework.Service\{TemplateConst.ModelName}\{TemplateConst.EntityName}Service.cs"; + BuildPath = $@"{TemplateConst.BuildRootPath}\Yi.Framework.Application\{TemplateConst.ModelName}\{TemplateConst.EntityName}Service.cs"; TemplatePath = $@"..\..\..\Template\Server\ServiceTemplate.txt"; } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/UpdateInputVoTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/UpdateInputVoTemplateProvider.cs index c9e7f4b2..40b9e52f 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/UpdateInputVoTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Server/UpdateInputVoTemplateProvider.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Template.Abstracts; +using Yi.Framework.Template.Abstract; using Yi.Framework.Template.ConstClasses; namespace Yi.Framework.Template.Provider.Server @@ -12,9 +12,9 @@ namespace Yi.Framework.Template.Provider.Server { public UpdateInputVoTemplateProvider(string modelName, string entityName) : base(modelName, entityName) { - BuildPath = $@"..\..\..\..\Yi.Framework.DtoModel\{TemplateConst.ModelName}\{TemplateConst.EntityName}\{TemplateConst.EntityName}UpdateInputVo.cs"; + BuildPath = $@"{TemplateConst.BuildRootPath}\Yi.Framework.Application.Contracts\{TemplateConst.ModelName}\Dtos\{TemplateConst.EntityName}UpdateInputVo.cs"; TemplatePath = $@"..\..\..\Template\Server\UpdateInputVoTemplate.txt"; - EntityPath = $@"..\..\..\..\Yi.Framework.Model\{TemplateConst.ModelName}\Entitys\{TemplateConst.EntityName}Entity.cs"; + EntityPath = $@"{TemplateConst.BuildEntityPath}\Yi.Framework.Domain\{TemplateConst.ModelName}\Entities\{TemplateConst.EntityName}Entity.cs"; } } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Site/ApiTemplateProvider.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Site/ApiTemplateProvider.cs index 5f80d526..5a164c5d 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Site/ApiTemplateProvider.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Provider/Site/ApiTemplateProvider.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Template.Abstracts; +using Yi.Framework.Template.Abstract; using Yi.Framework.Template.ConstClasses; namespace Yi.Framework.Template.Provider.Site diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ConstTemplate.txt b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ConstTemplate.txt index 4c589964..0ef4d1da 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ConstTemplate.txt +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ConstTemplate.txt @@ -4,8 +4,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Yi.Framework.DtoModel.#ModelName#.#EntityName#.ConstConfig +namespace Yi.Framework.Domain.Shared.#ModelName#.ConstClasses { + /// + /// 常量定义 + /// + public class #EntityName#Const { } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/CreateInputVoTemplate.txt b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/CreateInputVoTemplate.txt index de35e69a..7720a174 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/CreateInputVoTemplate.txt +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/CreateInputVoTemplate.txt @@ -1,14 +1,15 @@ -using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Model.Base; -namespace Yi.Framework.DtoModel.#ModelName#.#EntityName# +namespace Yi.Framework.Application.Contracts.#ModelName#.Dtos { - public class #EntityName#CreateUpdateInput : EntityDto + /// + /// #EntityName#输入创建对象 + /// + public class #EntityName#CreateInputVo { #EntityField# } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetListInputVoTemplate.txt b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetListInputVoTemplate.txt index d55956e8..3000aefa 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetListInputVoTemplate.txt +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetListInputVoTemplate.txt @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Model.Base; +using Yi.Framework.Ddd.Dtos; -namespace Yi.Framework.DtoModel.#ModelName#.#EntityName# +namespace Yi.Framework.Application.Contracts.#ModelName#.Dtos { - public class #EntityName#GetListInput + public class #EntityName#GetListInputVo : PagedAndSortedResultRequestDto { #EntityField# } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetListOutputDtoTemplate.txt b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetListOutputDtoTemplate.txt index 52e3c644..45417297 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetListOutputDtoTemplate.txt +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetListOutputDtoTemplate.txt @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Model.Base; +using Yi.Framework.Ddd.Dtos; -namespace Yi.Framework.DtoModel.#ModelName#.#EntityName# +namespace Yi.Framework.Application.Contracts.#ModelName#.Dtos { - public class #EntityName#GetListOutput: EntityDto + public class #EntityName#GetListOutputDto : IEntityDto { #EntityField# } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetOutputDtoTemplate.txt b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetOutputDtoTemplate.txt index 52e3c644..8ef5237d 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetOutputDtoTemplate.txt +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/GetOutputDtoTemplate.txt @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Model.Base; +using Yi.Framework.Ddd.Dtos; -namespace Yi.Framework.DtoModel.#ModelName#.#EntityName# +namespace Yi.Framework.Application.Contracts.#ModelName#.Dtos { - public class #EntityName#GetListOutput: EntityDto + public class #EntityName#GetOutputDto : IEntityDto { #EntityField# } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/IServiceTemplate.txt b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/IServiceTemplate.txt index 0e73fa41..67ba872d 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/IServiceTemplate.txt +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/IServiceTemplate.txt @@ -3,14 +3,16 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Common.Models; -using Yi.Framework.DtoModel.#ModelName#.#EntityName#; -using Yi.Framework.Interface.Base.Crud; +using Yi.Framework.Application.Contracts.#ModelName#.Dtos; +using Yi.Framework.Ddd.Services.Abstract; -namespace Yi.Framework.Interface.#ModelName# +namespace Yi.Framework.Application.Contracts.#ModelName# { - public interface I#EntityName#Service : ICrudAppService<#EntityName#GetListOutput, long, #EntityName#CreateUpdateInput> + /// + /// #EntityName# + /// + public interface I#EntityName#Service : ICrudAppService<#EntityName#GetOutputDto, #EntityName#GetListOutputDto, long, #EntityName#GetListInputVo, #EntityName#CreateInputVo, #EntityName#UpdateInputVo> { - Task>> PageListAsync(#EntityName#GetListInput input, PageParModel page); + } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ProfileTemplate.txt b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ProfileTemplate.txt index f545b835..0bf7fda1 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ProfileTemplate.txt +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ProfileTemplate.txt @@ -4,17 +4,20 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Model.#ModelName#.Entitys; +using Yi.Framework.Application.Contracts.#ModelName#.Dtos; +using Yi.Framework.Domain.#ModelName#.Entities; -namespace Yi.Framework.DtoModel.#ModelName#.#EntityName#.MapperConfig +namespace Yi.Framework.Application.#ModelName#.MapperConfig { - public class Suppli#ModelName#rofile:Profile + public class #EntityName#Profile: Profile { - public Suppli#ModelName#rofile() + public #EntityName#Profile() { - CreateMap<#EntityName#CreateUpdateInput, #EntityName#Entity>(); - CreateMap<#EntityName#Entity, #EntityName#GetListOutput>(); - + CreateMap<#EntityName#GetListInputVo, #EntityName#Entity>(); + CreateMap<#EntityName#CreateInputVo, #EntityName#Entity>(); + CreateMap<#EntityName#UpdateInputVo, #EntityName#Entity>(); + CreateMap<#EntityName#Entity, #EntityName#GetListOutputDto>(); + CreateMap<#EntityName#Entity, #EntityName#GetOutputDto>(); } } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ServiceTemplate.txt b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ServiceTemplate.txt index 078f4fcf..1ca19195 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ServiceTemplate.txt +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/ServiceTemplate.txt @@ -1,29 +1,17 @@ -using AutoMapper; -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Framework.Common.Models; -using Yi.Framework.DtoModel.#ModelName#.#EntityName#; -using Yi.Framework.Interface.#ModelName#; -using Yi.Framework.Model.#ModelName#.Entitys; -using Yi.Framework.Repository; -using Yi.Framework.Service.Base.Crud; +using Yi.Framework.Application.Contracts.#ModelName#; +using NET.AutoWebApi.Setting; +using Yi.Framework.Application.Contracts.#ModelName#.Dtos; +using Yi.Framework.Domain.#ModelName#.Entities; +using Yi.Framework.Ddd.Services; -namespace Yi.Framework.Service.#ModelName# +namespace Yi.Framework.Application.#ModelName# { - public class #EntityName#Service : CrudAppService<#EntityName#Entity, #EntityName#GetListOutput, long, #EntityName#CreateUpdateInput>, I#EntityName#Service + /// + /// #EntityName#服务实现 + /// + [AppService] + public class #EntityName#Service : CrudAppService<#EntityName#Entity, #EntityName#GetOutputDto, #EntityName#GetListOutputDto, long, #EntityName#GetListInputVo, #EntityName#CreateInputVo, #EntityName#UpdateInputVo>, + I#EntityName#Service, IAutoApiService { - public async Task>> PageListAsync(#EntityName#GetListInput input, PageParModel page) - { - RefAsync totalNumber = 0; - var data = await Repository._DbQueryable - .WhereIF(input.Code is not null,u=>u.Code.Contains(input.Code)) - .WhereIF(input.Name is not null, u => u.Name.Contains(input.Name)) - .ToPageListAsync(page.PageNum, page.PageSize, totalNumber); - return new PageModel> { Total = totalNumber.Value, Data = await MapToGetListOutputDtosAsync(data) }; - } } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/UpdateInputVoTemplate.txt b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/UpdateInputVoTemplate.txt index de35e69a..31c1aab0 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/UpdateInputVoTemplate.txt +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Template/Server/UpdateInputVoTemplate.txt @@ -1,14 +1,12 @@ -using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Model.Base; -namespace Yi.Framework.DtoModel.#ModelName#.#EntityName# +namespace Yi.Framework.Application.Contracts.#ModelName#.Dtos { - public class #EntityName#CreateUpdateInput : EntityDto + public class #EntityName#UpdateInputVo { #EntityField# } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/TemplateFactory.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/TemplateFactory.cs index 7ea472ac..2196a913 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/TemplateFactory.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/TemplateFactory.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Template.Abstracts; +using Yi.Framework.Template.Abstract; using Yi.Framework.Template.Provider; namespace Yi.Framework.Template diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Yi.Framework.Template.csproj b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Yi.Framework.Template.csproj index 403f1b58..aaa4b130 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Yi.Framework.Template.csproj +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Yi.Framework.Template.csproj @@ -11,16 +11,19 @@ Always - + Always - + Always - + Always - + + Always + + Always diff --git a/Yi.Framework.Net6/GlobalUsings.cs b/Yi.Framework.Net6/src/project/GlobalUsings.cs similarity index 100% rename from Yi.Framework.Net6/GlobalUsings.cs rename to Yi.Framework.Net6/src/project/GlobalUsings.cs diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/ApplicationContractsSwaggerDoc.xml b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/ApplicationContractsSwaggerDoc.xml index 86c22a7e..5bc19128 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/ApplicationContractsSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/ApplicationContractsSwaggerDoc.xml @@ -4,19 +4,14 @@ Yi.Framework.Application.Contracts - + Student输入创建对象 - + - 想看一下结果 - - - - - 服务抽象 + Student������� diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetOutputDto.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/Student/StudentGetOutputDto.cs similarity index 64% rename from Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetOutputDto.cs rename to Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/Student/StudentGetOutputDto.cs index 2146e653..06116174 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetOutputDto.cs +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/Student/StudentGetOutputDto.cs @@ -1,17 +1,17 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Yi.Framework.Ddd.Dtos; -namespace Yi.Framework.Application.Contracts.Student.Dtos +namespace Yi.Framework.Application.Contracts.School.Dtos { public class StudentGetOutputDto : IEntityDto { public long Id { get; set; } public string Name { get; set; } - - public long Number { get; set; } + public int? Height { get; set; } + public string? Phone { get; set; } } } diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentCreateInputVo.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentCreateInputVo.cs similarity index 58% rename from Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentCreateInputVo.cs rename to Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentCreateInputVo.cs index 1fb8c8c0..131f8d53 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentCreateInputVo.cs +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentCreateInputVo.cs @@ -1,18 +1,19 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Yi.Framework.Application.Contracts.Student.Dtos +namespace Yi.Framework.Application.Contracts.School.Dtos { /// /// Student输入创建对象 /// public class StudentCreateInputVo { + public long Id { get; set; } public string Name { get; set; } - - public long Number { get; set; } + public int? Height { get; set; } + public string? Phone { get; set; } } } diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentGetListInputVo.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentGetListInputVo.cs new file mode 100644 index 00000000..d3a07f2b --- /dev/null +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentGetListInputVo.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Ddd.Dtos; + +namespace Yi.Framework.Application.Contracts.School.Dtos +{ + public class StudentGetListInputVo : PagedAndSortedResultRequestDto + { + public long Id { get; set; } + public string Name { get; set; } + public int? Height { get; set; } + public string? Phone { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetListOutputDto.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentGetListOutputDto.cs similarity index 54% rename from Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetListOutputDto.cs rename to Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentGetListOutputDto.cs index e411d13e..29926bd7 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetListOutputDto.cs +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentGetListOutputDto.cs @@ -1,21 +1,17 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Yi.Framework.Ddd.Dtos; -namespace Yi.Framework.Application.Contracts.Student.Dtos +namespace Yi.Framework.Application.Contracts.School.Dtos { public class StudentGetListOutputDto : IEntityDto { public long Id { get; set; } public string Name { get; set; } - public long Number { get; set; } - - /// - /// 想看一下结果 - /// - public bool IsDeleted { get; set; } + public int? Height { get; set; } + public string? Phone { get; set; } } } diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentUpdateInputVo.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentUpdateInputVo.cs new file mode 100644 index 00000000..a03ef6a0 --- /dev/null +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/Dtos/StudentUpdateInputVo.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Application.Contracts.School.Dtos +{ + public class StudentUpdateInputVo + { + public long Id { get; set; } + public string Name { get; set; } + public int? Height { get; set; } + public string? Phone { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/IStudentService.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/IStudentService.cs similarity index 70% rename from Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/IStudentService.cs rename to Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/IStudentService.cs index e1905472..69ae0791 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/IStudentService.cs +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/School/IStudentService.cs @@ -1,15 +1,15 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Application.Contracts.Student.Dtos; +using Yi.Framework.Application.Contracts.School.Dtos; using Yi.Framework.Ddd.Services.Abstract; -namespace Yi.Framework.Application.Contracts.Student +namespace Yi.Framework.Application.Contracts.School { /// - /// 服务抽象 + /// Student������� /// public interface IStudentService : ICrudAppService { diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetListInputVo.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetListInputVo.cs deleted file mode 100644 index 1cb0d043..00000000 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentGetListInputVo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Framework.Ddd.Dtos; - -namespace Yi.Framework.Application.Contracts.Student.Dtos -{ - public class StudentGetListInputVo : PagedAndSortedResultRequestDto - { - public string? Name { get; set; } - - public long? Number { get; set; } - } -} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentUpdateInputVo.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentUpdateInputVo.cs deleted file mode 100644 index 1f6faca7..00000000 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Student/Dtos/StudentUpdateInputVo.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Yi.Framework.Application.Contracts.Student.Dtos -{ - public class StudentUpdateInputVo - { - public string? Name { get; set; } - - public long? Number { get; set; } - - public bool IsDeleted { get; set; } - } -} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Yi.Framework.Application.Contracts.csproj b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Yi.Framework.Application.Contracts.csproj index f31967bb..6ccd653f 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Yi.Framework.Application.Contracts.csproj +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application.Contracts/Yi.Framework.Application.Contracts.csproj @@ -8,7 +8,7 @@ ./ApplicationContractsSwaggerDoc.xml - + diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application/ApplicationSwaggerDoc.xml b/Yi.Framework.Net6/src/project/Yi.Framework.Application/ApplicationSwaggerDoc.xml index 150046e4..d58b17f6 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application/ApplicationSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application/ApplicationSwaggerDoc.xml @@ -4,29 +4,10 @@ Yi.Framework.Application - + - 服务实现 + Student服务实现 - - - 数据过滤测试 - - - - - - - 测试token - - - - - - Uow - - - diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application/Student/MapperConfig/StudentProfile.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application/School/MapperConfig/StudentProfile.cs similarity index 75% rename from Yi.Framework.Net6/src/project/Yi.Framework.Application/Student/MapperConfig/StudentProfile.cs rename to Yi.Framework.Net6/src/project/Yi.Framework.Application/School/MapperConfig/StudentProfile.cs index 171448c9..c34a7f65 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application/Student/MapperConfig/StudentProfile.cs +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application/School/MapperConfig/StudentProfile.cs @@ -1,13 +1,13 @@ -using AutoMapper; +using AutoMapper; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.Framework.Application.Contracts.Student.Dtos; -using Yi.Framework.Domain.Student.Entities; +using Yi.Framework.Application.Contracts.School.Dtos; +using Yi.Framework.Domain.School.Entities; -namespace Yi.Framework.Application.Student.MapperConfig +namespace Yi.Framework.Application.School.MapperConfig { public class StudentProfile: Profile { diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application/School/StudentService.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application/School/StudentService.cs new file mode 100644 index 00000000..1a1f919e --- /dev/null +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application/School/StudentService.cs @@ -0,0 +1,17 @@ +using Yi.Framework.Application.Contracts.School; +using NET.AutoWebApi.Setting; +using Yi.Framework.Application.Contracts.School.Dtos; +using Yi.Framework.Domain.School.Entities; +using Yi.Framework.Ddd.Services; + +namespace Yi.Framework.Application.School +{ + /// + /// Student服务实现 + /// + [AppService] + public class StudentService : CrudAppService, + IStudentService, IAutoApiService + { + } +} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application/Student/StudentService.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application/Student/StudentService.cs deleted file mode 100644 index b139b05c..00000000 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application/Student/StudentService.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Framework.Application.Contracts.Student; -using Yi.Framework.Domain.Student; -using Microsoft.AspNetCore.Mvc; -using NET.AutoWebApi.Setting; -using Microsoft.AspNetCore.Http; -using Yi.Framework.Ddd.Services.Abstract; -using Yi.Framework.Application.Contracts.Student.Dtos; -using Yi.Framework.Domain.Student.Entities; -using Yi.Framework.Ddd.Services; -using Yi.Framework.Core.Attributes; -using Yi.Framework.Uow; -using Microsoft.AspNetCore.Authorization; -using Yi.Framework.Auth.JwtBearer.Authentication; -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 -{ - /// - /// 服务实现 - /// - - [AppService] - public class StudentService : CrudAppService, - IStudentService, IAutoApiService - { - private readonly IStudentRepository _studentRepository; - private readonly StudentManager _studentManager; - private readonly IUnitOfWorkManager _unitOfWorkManager; - private readonly JwtTokenManager _jwtTokenManager; - private readonly 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; - - } - - /// - /// 测试token - /// - /// - public string GetToken() - { - var claimDic = new Dictionary() { { TokenTypeConst.Id, "123" }, { TokenTypeConst.UserName, "cc" } }; - return _jwtTokenManager.CreateToken(claimDic); - } - - /// - /// Uow - /// - /// - [Authorize] - [Permission(AuthStudentConst.查询)] - public async Task PostUow() - { - var o = _currentUser; - StudentGetOutputDto res = new(); - using (var uow = _unitOfWorkManager.CreateContext()) - { - var studentRepository = uow.GetRepository(); - res = await base.CreateAsync(new StudentCreateInputVo { Name = $"老杰哥{DateTime.Now.ToString("ffff")}", Number = 2023 }); - if (new Random().Next(0, 2) == 0) throw new NotImplementedException(); - uow.Commit(); - } - return res; - } - } -} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application/Yi.Framework.Application.csproj b/Yi.Framework.Net6/src/project/Yi.Framework.Application/Yi.Framework.Application.csproj index 34cf4d9c..b2a78df0 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application/Yi.Framework.Application.csproj +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application/Yi.Framework.Application.csproj @@ -8,11 +8,11 @@ ./ApplicationSwaggerDoc.xml - + - - + + diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Application/YiFrameworkApplicationModule.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Application/YiFrameworkApplicationModule.cs index 886ac2db..d28e6c57 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Application/YiFrameworkApplicationModule.cs +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Application/YiFrameworkApplicationModule.cs @@ -7,8 +7,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Yi.Framework.Application.Contracts; -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; diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/GlobalUsings.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/GlobalUsings.cs deleted file mode 100644 index 58c7f9f2..00000000 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/GlobalUsings.cs +++ /dev/null @@ -1 +0,0 @@ -global using Yi.Framework.Core.Attributes; \ No newline at end of file diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/Student/ConstClasses/StudentConst.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/School/ConstClasses/StudentConst.cs similarity index 57% rename from Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/Student/ConstClasses/StudentConst.cs rename to Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/School/ConstClasses/StudentConst.cs index d89c86e8..1357355b 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/Student/ConstClasses/StudentConst.cs +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/School/ConstClasses/StudentConst.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Yi.Framework.Domain.Shared.Student.ConstClasses +namespace Yi.Framework.Domain.Shared.School.ConstClasses { /// /// 常量定义 @@ -12,6 +12,5 @@ namespace Yi.Framework.Domain.Shared.Student.ConstClasses public class StudentConst { - public const string 学生已重复 = "失败!学生已经重复"; } } diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/Student/ConstClasses/AuthStudentConst.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/Student/ConstClasses/AuthStudentConst.cs deleted file mode 100644 index 5f3849af..00000000 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/Student/ConstClasses/AuthStudentConst.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Yi.Framework.Domain.Shared.Student.ConstClasses -{ - public class AuthStudentConst - { - public const string 查询 = "student:student:list"; - public const string 添加 = "student:student:add"; - } -} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/Yi.Framework.Domain.Shared.csproj b/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/Yi.Framework.Domain.Shared.csproj index 235d29e7..44dc3504 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/Yi.Framework.Domain.Shared.csproj +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Domain.Shared/Yi.Framework.Domain.Shared.csproj @@ -6,10 +6,10 @@ enable - + + + + - - - diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/DomainSwaggerDoc.xml b/Yi.Framework.Net6/src/project/Yi.Framework.Domain/DomainSwaggerDoc.xml index 2c280732..f8b62a77 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/DomainSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Domain/DomainSwaggerDoc.xml @@ -4,35 +4,5 @@ Yi.Framework.Domain - - - 学生实体 - - - - - 学生名称 - - - - - 学号 - - - - - 软删除 - - - - - 仓储抽象 - - - - - 领域服务 - - diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/School/Entities/StudentEntity.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Domain/School/Entities/StudentEntity.cs new file mode 100644 index 00000000..96086ed5 --- /dev/null +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Domain/School/Entities/StudentEntity.cs @@ -0,0 +1,25 @@ +using SqlSugar; +using System; +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.School.Entities +{ + [SugarTable("Student")] + public class StudentEntity : IEntity,ISoftDelete + { + [SugarColumn(IsPrimaryKey = true)] + public long Id { get; set; } + + public string Name { get; set; } + + public int? Height { get; set; } + + public string? Phone { get; set; } + public bool IsDeleted { get; set; } = false; + } +} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Student/Entities/StudentEntity.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Student/Entities/StudentEntity.cs deleted file mode 100644 index dc43ae7d..00000000 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Student/Entities/StudentEntity.cs +++ /dev/null @@ -1,36 +0,0 @@ -using SqlSugar; -using System; -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 -{ - /// - /// 学生实体 - /// - [SugarTable("Student")] - public class StudentEntity : IEntity, ISoftDelete - { - [SugarColumn(IsPrimaryKey = true)] - public long Id { get; set; } - - /// - /// 学生名称 - /// - public string Name { get; set; } = string.Empty; - - /// - /// 学号 - /// - public long Number { get;set ; } - - /// - /// 软删除 - /// - public bool IsDeleted { get; set; } - } -} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Student/Repositories/IStudentRepository.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Student/Repositories/IStudentRepository.cs deleted file mode 100644 index 9b0c4440..00000000 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Student/Repositories/IStudentRepository.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Framework.Ddd.Repositories; -using Yi.Framework.Domain.Student.Entities; - -namespace Yi.Framework.Domain.Student.Repositories -{ - /// - /// 仓储抽象 - /// - public interface IStudentRepository : IRepository - { - Task> GetMyListAsync(); - } -} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Student/StudentManager.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Student/StudentManager.cs deleted file mode 100644 index cf689add..00000000 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Student/StudentManager.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Framework.Domain.Student.Repositories; - -namespace Yi.Framework.Domain.Student -{ - /// - /// 领域服务 - /// - public class StudentManager - { - private readonly IStudentRepository _studentRepository; - public StudentManager(IStudentRepository studentRepository) - { - _studentRepository=studentRepository; - } - } -} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Yi.Framework.Domain.csproj b/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Yi.Framework.Domain.csproj index b7b74ac3..7d685fe2 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Yi.Framework.Domain.csproj +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Domain/Yi.Framework.Domain.csproj @@ -8,10 +8,10 @@ ./DomainSwaggerDoc.xml - + - + diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/YiFrameworkDomainModule.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Domain/YiFrameworkDomainModule.cs index 108a08e0..849f9f09 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Domain/YiFrameworkDomainModule.cs +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Domain/YiFrameworkDomainModule.cs @@ -9,7 +9,6 @@ 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 { @@ -25,7 +24,7 @@ namespace Yi.Framework.Domain public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context) { - services.AddTransient(); + //services.AddTransient(); } } } diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/PPPPPP/StudentRepository.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/PPPPPP/StudentRepository.cs new file mode 100644 index 00000000..5dbff403 --- /dev/null +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/PPPPPP/StudentRepository.cs @@ -0,0 +1,27 @@ +//using SqlSugar; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using Yi.Framework.Core.Sqlsugar.Repositories; +//using Yi.Framework.Domain.Teacher.Entities; +//using Yi.Framework.Domain.Teacher.Repositories; + +//namespace Yi.Framework.Sqlsugar.Teacher +//{ +// /// +// /// 仓储实现方式 +// /// +// public class StudentRepository : SqlsugarRepository, IStudentRepository +// { +// public StudentRepository(ISqlSugarClient context) : base(context) +// { +// } + +// public async Task> GetMyListAsync() +// { +// return await _DbQueryable.ToListAsync(); +// } +// } +//} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/Student/StudentRepository.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/Student/StudentRepository.cs deleted file mode 100644 index c29bf1c8..00000000 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/Student/StudentRepository.cs +++ /dev/null @@ -1,27 +0,0 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Yi.Framework.Core.Sqlsugar.Repositories; -using Yi.Framework.Domain.Student.Entities; -using Yi.Framework.Domain.Student.Repositories; - -namespace Yi.Framework.Sqlsugar.Student -{ - /// - /// 仓储实现方式 - /// - public class StudentRepository : SqlsugarRepository, IStudentRepository - { - public StudentRepository(ISqlSugarClient context) : base(context) - { - } - - public async Task> GetMyListAsync() - { - return await _DbQueryable.ToListAsync(); - } - } -} diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/Yi.Framework.Sqlsugar.csproj b/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/Yi.Framework.Sqlsugar.csproj index 7bebb145..1db3d881 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/Yi.Framework.Sqlsugar.csproj +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/Yi.Framework.Sqlsugar.csproj @@ -7,10 +7,10 @@ - + - + diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/YiFrameworkSqlsugarModule.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/YiFrameworkSqlsugarModule.cs index 27ed4df1..d3f38a69 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/YiFrameworkSqlsugarModule.cs +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Sqlsugar/YiFrameworkSqlsugarModule.cs @@ -9,8 +9,6 @@ using System.Threading.Tasks; using Yi.Framework.Core.Attributes; using Yi.Framework.Core.Sqlsugar; using Yi.Framework.Domain; -using Yi.Framework.Domain.Student.Repositories; -using Yi.Framework.Sqlsugar.Student; namespace Yi.Framework.Sqlsugar { @@ -24,7 +22,7 @@ namespace Yi.Framework.Sqlsugar public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context) { - services.AddTransient(); + //services.AddTransient(); } } } diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Web/Program.cs b/Yi.Framework.Net6/src/project/Yi.Framework.Web/Program.cs index d5053ec2..366cf1b2 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Web/Program.cs +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Web/Program.cs @@ -13,7 +13,6 @@ builder.WebHost.UseStartUrlsServer(builder.Configuration); //ģ builder.UseYiModules(typeof(YiFrameworkWebModule)); - //autofacģ,Ҫģ builder.Host.ConfigureAutoFacContainer(container => { diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Web/TimeTest.txt b/Yi.Framework.Net6/src/project/Yi.Framework.Web/TimeTest.txt index 26f6da0c..3cbeb894 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Web/TimeTest.txt +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Web/TimeTest.txt @@ -75,3 +75,11 @@ 2023:01:20-18:53:16本次运行启动时间为:5186毫秒 2023:01:20-19:01:36本次运行启动时间为:5194毫秒 2023:01:21-15:04:00本次运行启动时间为:7763毫秒 +2023:01:21-18:34:52本次运行启动时间为:2507毫秒 +2023:01:21-22:17:17本次运行启动时间为:2137毫秒 +2023:01:21-22:18:22本次运行启动时间为:2040毫秒 +2023:01:21-22:20:13本次运行启动时间为:1611毫秒 +2023:01:21-22:20:37本次运行启动时间为:1525毫秒 +2023:01:21-22:21:52本次运行启动时间为:1563毫秒 +2023:01:21-22:29:30本次运行启动时间为:9099毫秒 +2023:01:21-22:30:38本次运行启动时间为:2136毫秒 diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Web/Yi.Framework.Web.csproj b/Yi.Framework.Net6/src/project/Yi.Framework.Web/Yi.Framework.Web.csproj index bcfcd046..2ee891b5 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Web/Yi.Framework.Web.csproj +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Web/Yi.Framework.Web.csproj @@ -7,11 +7,10 @@ - + - diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Web/appsettings.json b/Yi.Framework.Net6/src/project/Yi.Framework.Web/appsettings.json index c78daa1d..0f5e58f3 100644 --- a/Yi.Framework.Net6/src/project/Yi.Framework.Web/appsettings.json +++ b/Yi.Framework.Net6/src/project/Yi.Framework.Web/appsettings.json @@ -18,7 +18,7 @@ "DbType": "Sqlite", "EnabledDbSeed": false, "EnabledReadWrite": false, - "EnabledCodeFirst": false, + "EnabledCodeFirst": true, "EntityAssembly": null, "ReadUrl": [ "DataSource=[xxxx]", //sqlite diff --git a/Yi.Framework.Net6/src/project/Yi.Framework.Web/yi-sqlsugar-dev.db b/Yi.Framework.Net6/src/project/Yi.Framework.Web/yi-sqlsugar-dev.db index 087c98f8..e84c3600 100644 Binary files a/Yi.Framework.Net6/src/project/Yi.Framework.Web/yi-sqlsugar-dev.db and b/Yi.Framework.Net6/src/project/Yi.Framework.Web/yi-sqlsugar-dev.db differ