简化对象映射Mapper,简化自定义仓储
This commit is contained in:
@@ -41,7 +41,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Uow", "src\fra
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Core.Sqlsugar", "src\framework\Yi.Framework.Core.Sqlsugar\Yi.Framework.Core.Sqlsugar.csproj", "{58F4071D-66B7-4839-A247-79AF0E4E1C8E}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Core.Sqlsugar", "src\framework\Yi.Framework.Core.Sqlsugar\Yi.Framework.Core.Sqlsugar.csproj", "{58F4071D-66B7-4839-A247-79AF0E4E1C8E}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Core.AutoMapper", "src\framework\Yi.Framework.Core.AutoMapper\Yi.Framework.Core.AutoMapper.csproj", "{DFD34702-2EF6-4ECC-AE6E-9A1A3885BD26}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Core.Mapster", "src\framework\Yi.Framework.Core.AutoMapper\Yi.Framework.Core.Mapster.csproj", "{DFD34702-2EF6-4ECC-AE6E-9A1A3885BD26}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Office.Excel", "src\module\Yi.Framework.Office.Excel\Yi.Framework.Office.Excel.csproj", "{4EEC6607-F0D8-4277-9463-104DA7E184B6}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.Office.Excel", "src\module\Yi.Framework.Office.Excel\Yi.Framework.Office.Excel.csproj", "{4EEC6607-F0D8-4277-9463-104DA7E184B6}"
|
||||||
EndProject
|
EndProject
|
||||||
@@ -83,7 +83,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.RBAC.Application", "src\
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.RBAC.Web", "src\project\rbac\Yi.RBAC.Web\Yi.RBAC.Web.csproj", "{0C031C7D-6F80-4559-977C-AC001036EC44}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.RBAC.Web", "src\project\rbac\Yi.RBAC.Web\Yi.RBAC.Web.csproj", "{0C031C7D-6F80-4559-977C-AC001036EC44}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.ThumbnailSharp", "src\module\Yi.Framework.ThumbnailSharp\Yi.Framework.ThumbnailSharp.csproj", "{60E54034-792C-4A90-BCDF-4D5FFB45089E}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.ThumbnailSharp", "src\module\Yi.Framework.ThumbnailSharp\Yi.Framework.ThumbnailSharp.csproj", "{60E54034-792C-4A90-BCDF-4D5FFB45089E}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
|
|
||||||
using AutoMapper;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.Framework.Core.Helper;
|
|
||||||
|
|
||||||
namespace Yi.Framework.Autofac.Extensions
|
|
||||||
{
|
|
||||||
public static class AutoMapperExtensions
|
|
||||||
{
|
|
||||||
public static IServiceCollection AddAutoMapperService(this IServiceCollection services)
|
|
||||||
{
|
|
||||||
//这里会通过反射,扫码全部程序集获取继承Profile的类
|
|
||||||
var assemblies = AppDomain.CurrentDomain.GetAssemblies().ToList();
|
|
||||||
|
|
||||||
var profileList = new List<Type>();
|
|
||||||
assemblies.ForEach(a =>
|
|
||||||
{
|
|
||||||
if (a.FullName is not null)
|
|
||||||
{
|
|
||||||
profileList.AddRange(AssemblyHelper.GetClassByParentClass(a.FullName, typeof(Profile)));
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
services.AddAutoMapper(profileList.ToArray());
|
|
||||||
return services;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,12 +6,16 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Yi.Framework.Core\Yi.Framework.Core.csproj" />
|
<ProjectReference Include="..\Yi.Framework.Core\Yi.Framework.Core.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Extensions\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Mapster" Version="7.3.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Microsoft.AspNetCore.Builder;
|
using MapsterMapper;
|
||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using StartupModules;
|
using StartupModules;
|
||||||
using Yi.Framework.Autofac.Extensions;
|
|
||||||
using Yi.Framework.Core.Attributes;
|
using Yi.Framework.Core.Attributes;
|
||||||
|
|
||||||
namespace Yi.Framework.Core.AutoMapper
|
namespace Yi.Framework.Core.AutoMapper
|
||||||
@@ -9,7 +9,7 @@ namespace Yi.Framework.Core.AutoMapper
|
|||||||
[DependsOn(
|
[DependsOn(
|
||||||
typeof(YiFrameworkCoreModule)
|
typeof(YiFrameworkCoreModule)
|
||||||
)]
|
)]
|
||||||
public class YiFrameworkCoreAutoMapperModule : IStartupModule
|
public class YiFrameworkCoreMapsterModule : IStartupModule
|
||||||
{
|
{
|
||||||
|
|
||||||
public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context)
|
public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context)
|
||||||
@@ -20,7 +20,7 @@ namespace Yi.Framework.Core.AutoMapper
|
|||||||
{
|
{
|
||||||
|
|
||||||
//添加全局自动mapper
|
//添加全局自动mapper
|
||||||
services.AddAutoMapperService();
|
services.AddSingleton<IMapper, Mapper>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,7 +22,10 @@ namespace Yi.Framework.Core.Sqlsugar.Repositories
|
|||||||
public SqlsugarRepository(ISqlSugarClient context) : base(context)
|
public SqlsugarRepository(ISqlSugarClient context) : base(context)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
protected ISugarQueryable<T> _DbQueryable { get { return base.AsQueryable(); } set { } }
|
/// <summary>
|
||||||
|
/// 注释一下,严格意义这里应该protected,但是我认为 简易程度 与 耦合程度 中是需要进行衡量的
|
||||||
|
/// </summary>
|
||||||
|
public ISugarQueryable<T> _DbQueryable => base.AsQueryable();
|
||||||
|
|
||||||
protected ISqlSugarClient _Db { get { return Context; } set { } }
|
protected ISqlSugarClient _Db { get { return Context; } set { } }
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
@@ -10,8 +11,12 @@ using Yi.Framework.Ddd.Entities;
|
|||||||
|
|
||||||
namespace Yi.Framework.Ddd.Repositories
|
namespace Yi.Framework.Ddd.Repositories
|
||||||
{
|
{
|
||||||
public interface IRepository<T>
|
public interface IRepository<T>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 注释一下,严格意义这里应该protected,但是我认为 简易程度 与 耦合程度 中是需要进行衡量的
|
||||||
|
/// </summary>
|
||||||
|
ISugarQueryable<T> _DbQueryable { get; }
|
||||||
//单查
|
//单查
|
||||||
Task<T> GetByIdAsync(dynamic id);
|
Task<T> GetByIdAsync(dynamic id);
|
||||||
Task<T> GetSingleAsync(Expression<Func<T, bool>> whereExpression);
|
Task<T> GetSingleAsync(Expression<Func<T, bool>> whereExpression);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using AutoMapper;
|
using MapsterMapper;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
using Yi.Framework.Core.Model;
|
using Yi.Framework.Core.Model;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -39,6 +40,8 @@ where TEntityDto : IEntityDto<TKey>
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected IRepository<TEntity> _repository { get => ServiceLocatorModel.Instance.GetRequiredService<IRepository<TEntity>>(); }
|
protected IRepository<TEntity> _repository { get => ServiceLocatorModel.Instance.GetRequiredService<IRepository<TEntity>>(); }
|
||||||
|
|
||||||
|
protected ISugarQueryable<TEntity> _DbQueryable => _repository._DbQueryable;
|
||||||
|
|
||||||
//Mapper
|
//Mapper
|
||||||
protected virtual Task<TGetOutputDto> MapToGetOutputDtoAsync(TEntity entity)
|
protected virtual Task<TGetOutputDto> MapToGetOutputDtoAsync(TEntity entity)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Yi.Framework.Core.Autofac\Yi.Framework.Core.Autofac.csproj" />
|
<ProjectReference Include="..\Yi.Framework.Core.Autofac\Yi.Framework.Core.Autofac.csproj" />
|
||||||
<ProjectReference Include="..\Yi.Framework.Core.AutoMapper\Yi.Framework.Core.AutoMapper.csproj" />
|
<ProjectReference Include="..\Yi.Framework.Core.AutoMapper\Yi.Framework.Core.Mapster.csproj" />
|
||||||
<ProjectReference Include="..\Yi.Framework.Core\Yi.Framework.Core.csproj" />
|
<ProjectReference Include="..\Yi.Framework.Core\Yi.Framework.Core.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using Yi.Framework.Core.AutoMapper;
|
|||||||
namespace Yi.Framework.Ddd
|
namespace Yi.Framework.Ddd
|
||||||
{
|
{
|
||||||
[DependsOn(
|
[DependsOn(
|
||||||
typeof(YiFrameworkCoreAutoMapperModule)
|
typeof(YiFrameworkCoreMapsterModule)
|
||||||
)]
|
)]
|
||||||
public class YiFrameworkDddModule:IStartupModule
|
public class YiFrameworkDddModule:IStartupModule
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,11 @@
|
|||||||
<name>Yi.Framework.Ddd</name>
|
<name>Yi.Framework.Ddd</name>
|
||||||
</assembly>
|
</assembly>
|
||||||
<members>
|
<members>
|
||||||
|
<member name="P:Yi.Framework.Ddd.Repositories.IRepository`1._DbQueryable">
|
||||||
|
<summary>
|
||||||
|
注释一下,严格意义这里应该protected,但是我认为 简易程度 与 耦合程度 中是需要进行衡量的
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="M:Yi.Framework.Ddd.Services.CrudAppService`7.CreateAsync(`5)">
|
<member name="M:Yi.Framework.Ddd.Services.CrudAppService`7.CreateAsync(`5)">
|
||||||
<summary>
|
<summary>
|
||||||
增
|
增
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ foreach (var entityName in entityNames)
|
|||||||
option.Add(new GetOutputDtoTemplateProvider(modelName, entityName, nameSpaces));
|
option.Add(new GetOutputDtoTemplateProvider(modelName, entityName, nameSpaces));
|
||||||
|
|
||||||
option.Add(new ConstTemplateProvider(modelName, entityName, nameSpaces));
|
option.Add(new ConstTemplateProvider(modelName, entityName, nameSpaces));
|
||||||
option.Add(new ProfileTemplateProvider(modelName, entityName, nameSpaces));
|
|
||||||
//option.Add(new ApiTemplateProvider(modelName, entityName));
|
//option.Add(new ApiTemplateProvider(modelName, entityName));
|
||||||
});
|
});
|
||||||
//开始构建模板
|
//开始构建模板
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.Framework.Template.Abstract;
|
|
||||||
using Yi.Framework.Template.ConstClasses;
|
|
||||||
|
|
||||||
namespace Yi.Framework.Template.Provider.Server
|
|
||||||
{
|
|
||||||
public class ProfileTemplateProvider : ProgramTemplateProvider
|
|
||||||
{
|
|
||||||
public ProfileTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces)
|
|
||||||
{
|
|
||||||
BuildPath = $@"{TemplateConst.BuildRootPath}\{nameSpaces}.Application\{TemplateConst.ModelName}\MapperConfig\{TemplateConst.EntityName}Profile.cs";
|
|
||||||
TemplatePath = $@"..\..\..\Template\Server\ProfileTemplate.txt";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.Template.Application.Contracts.School.Dtos;
|
|
||||||
using Yi.Template.Domain.School.Entities;
|
|
||||||
|
|
||||||
namespace Yi.Template.Application.School.MapperConfig
|
|
||||||
{
|
|
||||||
public class StudentProfile: Profile
|
|
||||||
{
|
|
||||||
public StudentProfile()
|
|
||||||
{
|
|
||||||
CreateMap<StudentGetListInputVo, StudentEntity>();
|
|
||||||
CreateMap<StudentCreateInputVo, StudentEntity>();
|
|
||||||
CreateMap<StudentUpdateInputVo, StudentEntity>();
|
|
||||||
CreateMap<StudentEntity, StudentGetListOutputDto>();
|
|
||||||
CreateMap<StudentEntity, StudentGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.BBS.Application.Contracts.Exhibition.Dtos;
|
|
||||||
using Yi.BBS.Application.Contracts.Exhibition.Dtos.Banner;
|
|
||||||
using Yi.BBS.Domain.Exhibition.Entities;
|
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Exhibition.MapperConfig
|
|
||||||
{
|
|
||||||
public class BannerProfile: Profile
|
|
||||||
{
|
|
||||||
public BannerProfile()
|
|
||||||
{
|
|
||||||
CreateMap<BannerGetListInputVo, BannerEntity>();
|
|
||||||
CreateMap<BannerCreateInputVo, BannerEntity>();
|
|
||||||
CreateMap<BannerUpdateInputVo, BannerEntity>();
|
|
||||||
CreateMap<BannerEntity, BannerGetListOutputDto>();
|
|
||||||
CreateMap<BannerEntity, BannerGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,7 +7,7 @@ using Yi.BBS.Application.Contracts.Forum.Dtos.Discuss;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Yi.Framework.Ddd.Dtos;
|
using Yi.Framework.Ddd.Dtos;
|
||||||
using Yi.BBS.Domain.Forum;
|
using Yi.BBS.Domain.Forum;
|
||||||
using AutoMapper;
|
using MapsterMapper;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Microsoft.AspNetCore.Routing;
|
using Microsoft.AspNetCore.Routing;
|
||||||
using Yi.BBS.Domain.Shared.Forum.ConstClasses;
|
using Yi.BBS.Domain.Shared.Forum.ConstClasses;
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
|
||||||
using Yi.BBS.Domain.Forum.Entities;
|
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Forum.MapperConfig
|
|
||||||
{
|
|
||||||
public class ArticleProfile: Profile
|
|
||||||
{
|
|
||||||
public ArticleProfile()
|
|
||||||
{
|
|
||||||
CreateMap<ArticleGetListInputVo, ArticleEntity>();
|
|
||||||
CreateMap<ArticleCreateInputVo, ArticleEntity>();
|
|
||||||
CreateMap<ArticleUpdateInputVo, ArticleEntity>();
|
|
||||||
CreateMap<ArticleEntity, ArticleAllOutputDto>();
|
|
||||||
CreateMap<ArticleEntity, ArticleGetListOutputDto>();
|
|
||||||
CreateMap<ArticleEntity, ArticleGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
|
||||||
using Yi.BBS.Domain.Forum.Entities;
|
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Forum.MapperConfig
|
|
||||||
{
|
|
||||||
public class CommentProfile: Profile
|
|
||||||
{
|
|
||||||
public CommentProfile()
|
|
||||||
{
|
|
||||||
CreateMap<CommentGetListInputVo, CommentEntity>();
|
|
||||||
CreateMap<CommentCreateInputVo, CommentEntity>();
|
|
||||||
CreateMap<CommentUpdateInputVo, CommentEntity>();
|
|
||||||
CreateMap<CommentEntity, CommentGetListOutputDto>();
|
|
||||||
CreateMap<CommentEntity, CommentGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
|
||||||
using Yi.BBS.Application.Contracts.Forum.Dtos.Discuss;
|
|
||||||
using Yi.BBS.Domain.Forum.Entities;
|
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Forum.MapperConfig
|
|
||||||
{
|
|
||||||
public class DiscussProfile: Profile
|
|
||||||
{
|
|
||||||
public DiscussProfile()
|
|
||||||
{
|
|
||||||
CreateMap<DiscussGetListInputVo, DiscussEntity>();
|
|
||||||
CreateMap<DiscussCreateInputVo, DiscussEntity>();
|
|
||||||
CreateMap<DiscussUpdateInputVo, DiscussEntity>();
|
|
||||||
CreateMap<DiscussEntity, DiscussGetListOutputDto>();
|
|
||||||
CreateMap<DiscussEntity, DiscussGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
|
||||||
using Yi.BBS.Domain.Forum.Entities;
|
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Forum.MapperConfig
|
|
||||||
{
|
|
||||||
public class MyTypeProfile: Profile
|
|
||||||
{
|
|
||||||
public MyTypeProfile()
|
|
||||||
{
|
|
||||||
CreateMap<MyTypeGetListInputVo, MyTypeEntity>();
|
|
||||||
CreateMap<MyTypeCreateInputVo, MyTypeEntity>();
|
|
||||||
CreateMap<MyTypeUpdateInputVo, MyTypeEntity>();
|
|
||||||
CreateMap<MyTypeEntity, MyTypeGetListOutputDto>();
|
|
||||||
CreateMap<MyTypeEntity, MyTypeOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.BBS.Application.Contracts.Forum.Dtos;
|
|
||||||
using Yi.BBS.Application.Contracts.Forum.Dtos.Plate;
|
|
||||||
using Yi.BBS.Domain.Forum.Entities;
|
|
||||||
|
|
||||||
namespace Yi.BBS.Application.Forum.MapperConfig
|
|
||||||
{
|
|
||||||
public class PlateProfile: Profile
|
|
||||||
{
|
|
||||||
public PlateProfile()
|
|
||||||
{
|
|
||||||
CreateMap<PlateGetListInputVo, PlateEntity>();
|
|
||||||
CreateMap<PlateCreateInputVo, PlateEntity>();
|
|
||||||
CreateMap<PlateUpdateInputVo, PlateEntity>();
|
|
||||||
CreateMap<PlateEntity, PlateGetListOutputDto>();
|
|
||||||
CreateMap<PlateEntity, PlateGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -23,11 +23,15 @@ namespace Yi.RBAC.Application.Dictionary
|
|||||||
private IDictionaryRepository _dictionaryRepository { get; set; }
|
private IDictionaryRepository _dictionaryRepository { get; set; }
|
||||||
public override async Task<PagedResultDto<DictionaryGetListOutputDto>> GetListAsync(DictionaryGetListInputVo input)
|
public override async Task<PagedResultDto<DictionaryGetListOutputDto>> GetListAsync(DictionaryGetListInputVo input)
|
||||||
{
|
{
|
||||||
var data = await _dictionaryRepository.SelectGetListAsync(await MapToEntityAsync(input), input);
|
int total = 0;
|
||||||
|
var entities = await _DbQueryable.WhereIF(input.DictType is not null, x => x.DictType == input.DictType)
|
||||||
|
.WhereIF(input.DictLabel is not null, x => x.DictLabel!.Contains(input.DictLabel!))
|
||||||
|
.WhereIF(input.State is not null, x => x.State == input.State)
|
||||||
|
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||||
return new PagedResultDto<DictionaryGetListOutputDto>
|
return new PagedResultDto<DictionaryGetListOutputDto>
|
||||||
{
|
{
|
||||||
Total = data.Total,
|
Total = total,
|
||||||
Items = await MapToGetListOutputDtosAsync(data.Items)
|
Items = await MapToGetListOutputDtosAsync(entities)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using Yi.RBAC.Domain.Dictionary.Entities;
|
|||||||
using Yi.Framework.Ddd.Services;
|
using Yi.Framework.Ddd.Services;
|
||||||
using Yi.RBAC.Domain.Dictionary.Repositories;
|
using Yi.RBAC.Domain.Dictionary.Repositories;
|
||||||
using Yi.Framework.Ddd.Dtos;
|
using Yi.Framework.Ddd.Dtos;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Yi.RBAC.Application.Dictionary
|
namespace Yi.RBAC.Application.Dictionary
|
||||||
{
|
{
|
||||||
@@ -21,11 +22,18 @@ namespace Yi.RBAC.Application.Dictionary
|
|||||||
|
|
||||||
public async override Task<PagedResultDto<DictionaryTypeGetListOutputDto>> GetListAsync(DictionaryTypeGetListInputVo input)
|
public async override Task<PagedResultDto<DictionaryTypeGetListOutputDto>> GetListAsync(DictionaryTypeGetListInputVo input)
|
||||||
{
|
{
|
||||||
var data = await _dictionaryTypeRepository.SelectGetListAsync(await MapToEntityAsync(input), input);
|
|
||||||
|
int total = 0;
|
||||||
|
var entities = await _DbQueryable.WhereIF(input.DictName is not null, x => x.DictName.Contains(input.DictName!))
|
||||||
|
.WhereIF(input.DictType is not null, x => x.DictType!.Contains(input.DictType!))
|
||||||
|
.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)
|
||||||
|
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||||
|
|
||||||
return new PagedResultDto<DictionaryTypeGetListOutputDto>
|
return new PagedResultDto<DictionaryTypeGetListOutputDto>
|
||||||
{
|
{
|
||||||
Total = data.Total,
|
Total = total,
|
||||||
Items = await MapToGetListOutputDtosAsync(data.Items)
|
Items = await MapToGetListOutputDtosAsync(entities)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
|
|
||||||
using Yi.RBAC.Domain.Dictionary.Entities;
|
|
||||||
|
|
||||||
namespace Yi.RBAC.Application.Dictionary.MapperConfig
|
|
||||||
{
|
|
||||||
public class DictionaryProfile: Profile
|
|
||||||
{
|
|
||||||
public DictionaryProfile()
|
|
||||||
{
|
|
||||||
CreateMap<DictionaryGetListInputVo, DictionaryEntity>();
|
|
||||||
CreateMap<DictionaryCreateInputVo, DictionaryEntity>();
|
|
||||||
CreateMap<DictionaryUpdateInputVo, DictionaryEntity>();
|
|
||||||
CreateMap<DictionaryEntity, DictionaryGetListOutputDto>();
|
|
||||||
CreateMap<DictionaryEntity, DictionaryGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.RBAC.Application.Contracts.Dictionary.Dtos;
|
|
||||||
using Yi.RBAC.Domain.Dictionary.Entities;
|
|
||||||
|
|
||||||
namespace Yi.RBAC.Application.Dictionary.MapperConfig
|
|
||||||
{
|
|
||||||
public class DictionaryTypeProfile: Profile
|
|
||||||
{
|
|
||||||
public DictionaryTypeProfile()
|
|
||||||
{
|
|
||||||
CreateMap<DictionaryTypeGetListInputVo, DictionaryTypeEntity>();
|
|
||||||
CreateMap<DictionaryTypeCreateInputVo, DictionaryTypeEntity>();
|
|
||||||
CreateMap<DictionaryTypeUpdateInputVo, DictionaryTypeEntity>();
|
|
||||||
CreateMap<DictionaryTypeEntity, DictionaryTypeGetListOutputDto>();
|
|
||||||
CreateMap<DictionaryTypeEntity, DictionaryTypeGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
|
||||||
using Yi.RBAC.Domain.Identity.Entities;
|
|
||||||
|
|
||||||
namespace Yi.RBAC.Application.Identity.MapperConfig
|
|
||||||
{
|
|
||||||
public class DeptProfile: Profile
|
|
||||||
{
|
|
||||||
public DeptProfile()
|
|
||||||
{
|
|
||||||
CreateMap<DeptGetListInputVo, DeptEntity>();
|
|
||||||
CreateMap<DeptCreateInputVo, DeptEntity>();
|
|
||||||
CreateMap<DeptUpdateInputVo, DeptEntity>();
|
|
||||||
CreateMap<DeptEntity, DeptGetListOutputDto>();
|
|
||||||
CreateMap<DeptEntity, DeptGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
|
||||||
using Yi.RBAC.Domain.Identity.Entities;
|
|
||||||
|
|
||||||
namespace Yi.RBAC.Application.Identity.MapperConfig
|
|
||||||
{
|
|
||||||
public class MenuProfile: Profile
|
|
||||||
{
|
|
||||||
public MenuProfile()
|
|
||||||
{
|
|
||||||
CreateMap<MenuGetListInputVo, MenuEntity>();
|
|
||||||
CreateMap<MenuCreateInputVo, MenuEntity>();
|
|
||||||
CreateMap<MenuUpdateInputVo, MenuEntity>();
|
|
||||||
CreateMap<MenuEntity, MenuGetListOutputDto>();
|
|
||||||
CreateMap<MenuEntity, MenuGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
|
||||||
using Yi.RBAC.Domain.Identity.Entities;
|
|
||||||
|
|
||||||
namespace Yi.RBAC.Application.Identity.MapperConfig
|
|
||||||
{
|
|
||||||
public class PostProfile: Profile
|
|
||||||
{
|
|
||||||
public PostProfile()
|
|
||||||
{
|
|
||||||
CreateMap<PostGetListInputVo, PostEntity>();
|
|
||||||
CreateMap<PostCreateInputVo, PostEntity>();
|
|
||||||
CreateMap<PostUpdateInputVo, PostEntity>();
|
|
||||||
CreateMap<PostEntity, PostGetListOutputDto>();
|
|
||||||
CreateMap<PostEntity, PostGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
|
||||||
using Yi.RBAC.Domain.Identity.Entities;
|
|
||||||
|
|
||||||
namespace Yi.RBAC.Application.Identity.MapperConfig
|
|
||||||
{
|
|
||||||
public class RoleProfile: Profile
|
|
||||||
{
|
|
||||||
public RoleProfile()
|
|
||||||
{
|
|
||||||
CreateMap<RoleGetListInputVo, RoleEntity>();
|
|
||||||
CreateMap<RoleCreateInputVo, RoleEntity>();
|
|
||||||
CreateMap<RoleUpdateInputVo, RoleEntity>();
|
|
||||||
CreateMap<RoleEntity, RoleGetListOutputDto>();
|
|
||||||
CreateMap<RoleEntity, RoleGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
|
||||||
using Yi.RBAC.Domain.Identity.Entities;
|
|
||||||
|
|
||||||
namespace Yi.RBAC.Application.Identity.MapperConfig
|
|
||||||
{
|
|
||||||
public class UserProfile: Profile
|
|
||||||
{
|
|
||||||
public UserProfile()
|
|
||||||
{
|
|
||||||
CreateMap<UserGetListInputVo, UserEntity>();
|
|
||||||
CreateMap<UserCreateInputVo, UserEntity>();
|
|
||||||
CreateMap<UserUpdateInputVo, UserEntity>();
|
|
||||||
CreateMap<UserEntity, UserGetListOutputDto>();
|
|
||||||
CreateMap<UserEntity, UserGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -35,10 +35,17 @@ namespace Yi.RBAC.Application.Identity
|
|||||||
public override async Task<PagedResultDto<UserGetListOutputDto>> GetListAsync(UserGetListInputVo input)
|
public override async Task<PagedResultDto<UserGetListOutputDto>> GetListAsync(UserGetListInputVo input)
|
||||||
{
|
{
|
||||||
var entity = await MapToEntityAsync(input);
|
var entity = await MapToEntityAsync(input);
|
||||||
var entities = await _userRepository.SelctGetListAsync(entity, input);
|
|
||||||
|
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 result = new PagedResultDto<UserGetListOutputDto>();
|
var result = new PagedResultDto<UserGetListOutputDto>();
|
||||||
result.Items = await MapToGetListOutputDtosAsync(entities);
|
result.Items = await MapToGetListOutputDtosAsync(entities);
|
||||||
result.Total = await _repository.CountAsync(_ => true);
|
result.Total = total;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -669,14 +669,6 @@
|
|||||||
<param name="userId"></param>
|
<param name="userId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Yi.RBAC.Domain.Identity.Repositories.IUserRepository.SelctGetListAsync(Yi.RBAC.Domain.Identity.Entities.UserEntity,Yi.Framework.Ddd.Dtos.Abstract.IPagedAllResultRequestDto)">
|
|
||||||
<summary>
|
|
||||||
动态分页选择
|
|
||||||
</summary>
|
|
||||||
<param name="input"></param>
|
|
||||||
<param name="pageInput"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:Yi.RBAC.Domain.Identity.UserManager.GiveUserSetRoleAsync(System.Collections.Generic.List{System.Int64},System.Collections.Generic.List{System.Int64})">
|
<member name="M:Yi.RBAC.Domain.Identity.UserManager.GiveUserSetRoleAsync(System.Collections.Generic.List{System.Int64},System.Collections.Generic.List{System.Int64})">
|
||||||
<summary>
|
<summary>
|
||||||
给用户设置角色
|
给用户设置角色
|
||||||
|
|||||||
@@ -21,12 +21,5 @@ namespace Yi.RBAC.Domain.Identity.Repositories
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<UserRoleMenuDto> GetUserAllInfoAsync(long userId);
|
Task<UserRoleMenuDto> GetUserAllInfoAsync(long userId);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 动态分页选择
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <param name="pageInput"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<UserEntity>> SelctGetListAsync(UserEntity input, IPagedAllResultRequestDto pageInput);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.Core.Sqlsugar.Repositories;
|
|
||||||
using Yi.Framework.Ddd.Dtos;
|
|
||||||
using Yi.Framework.Ddd.Dtos.Abstract;
|
|
||||||
using Yi.RBAC.Domain.Dictionary.Entities;
|
|
||||||
using Yi.RBAC.Domain.Dictionary.Repositories;
|
|
||||||
using Yi.RBAC.Domain.Identity.Entities;
|
|
||||||
using Yi.RBAC.Domain.Identity.Repositories;
|
|
||||||
|
|
||||||
namespace Yi.RBAC.Sqlsugar.Repositories
|
|
||||||
{
|
|
||||||
[AppService]
|
|
||||||
public class DictionaryRepository : SqlsugarRepository<DictionaryEntity>, IDictionaryRepository
|
|
||||||
{
|
|
||||||
public DictionaryRepository(ISqlSugarClient context) : base(context)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<PagedDto<DictionaryEntity>> SelectGetListAsync(DictionaryEntity input, IPagedAndSortedResultRequestDto pageInput)
|
|
||||||
{
|
|
||||||
RefAsync<int> total = 0;
|
|
||||||
var entities = await _DbQueryable.WhereIF(input.DictType is not null, x => x.DictType == input.DictType)
|
|
||||||
.WhereIF(input.DictLabel is not null, x => x.DictLabel!.Contains(input.DictLabel!))
|
|
||||||
.WhereIF(input.State is not null,x => x.State == input.State)
|
|
||||||
.ToPageListAsync(pageInput.PageNum, pageInput.PageSize, total);
|
|
||||||
|
|
||||||
|
|
||||||
return new PagedDto<DictionaryEntity>(total, entities);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +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.Ddd.Dtos;
|
|
||||||
using Yi.Framework.Ddd.Dtos.Abstract;
|
|
||||||
using Yi.RBAC.Domain.Dictionary.Entities;
|
|
||||||
using Yi.RBAC.Domain.Dictionary.Repositories;
|
|
||||||
|
|
||||||
namespace Yi.RBAC.Sqlsugar.Repositories
|
|
||||||
{
|
|
||||||
[AppService]
|
|
||||||
public class DictionaryTypeRepository : SqlsugarRepository<DictionaryTypeEntity>, IDictionaryTypeRepository
|
|
||||||
{
|
|
||||||
public DictionaryTypeRepository(ISqlSugarClient context) : base(context)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<PagedDto<DictionaryTypeEntity>> SelectGetListAsync(DictionaryTypeEntity input, IPagedAllResultRequestDto pageInput)
|
|
||||||
{
|
|
||||||
RefAsync<int> total = 0;
|
|
||||||
var entities = await _DbQueryable.WhereIF(input.DictName is not null, x => x.DictName.Contains(input.DictName!))
|
|
||||||
.WhereIF(input.DictType is not null, x => x.DictType!.Contains(input.DictType!))
|
|
||||||
.WhereIF(input.State is not null, x => x.State == input.State)
|
|
||||||
.WhereIF(pageInput.StartTime is not null && pageInput.EndTime is not null ,x=>x.CreationTime>=pageInput.StartTime && x.CreationTime<=pageInput.EndTime)
|
|
||||||
.ToPageListAsync(pageInput.PageNum, pageInput.PageSize, total);
|
|
||||||
|
|
||||||
|
|
||||||
return new PagedDto<DictionaryTypeEntity>(total, entities);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,15 +24,6 @@ namespace Yi.RBAC.Sqlsugar.Repositories
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<List<UserEntity>> SelctGetListAsync(UserEntity input, IPagedAllResultRequestDto pageInput)
|
|
||||||
{
|
|
||||||
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(pageInput.StartTime is not null && pageInput.EndTime is not null, x => x.CreationTime >= pageInput.StartTime && x.CreationTime <= pageInput.EndTime).ToPageListAsync(pageInput.PageNum, pageInput.PageSize);
|
|
||||||
|
|
||||||
return entities;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取用户id的全部信息
|
/// 获取用户id的全部信息
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
using AutoMapper;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Yi.Template.Application.Contracts.School.Dtos;
|
|
||||||
using Yi.Template.Domain.School.Entities;
|
|
||||||
|
|
||||||
namespace Yi.Template.Application.School.MapperConfig
|
|
||||||
{
|
|
||||||
public class StudentProfile: Profile
|
|
||||||
{
|
|
||||||
public StudentProfile()
|
|
||||||
{
|
|
||||||
CreateMap<StudentGetListInputVo, StudentEntity>();
|
|
||||||
CreateMap<StudentCreateInputVo, StudentEntity>();
|
|
||||||
CreateMap<StudentUpdateInputVo, StudentEntity>();
|
|
||||||
CreateMap<StudentEntity, StudentGetListOutputDto>();
|
|
||||||
CreateMap<StudentEntity, StudentGetOutputDto>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user