refactor: ai+人工重构优化 framework
This commit is contained in:
@@ -7,18 +7,51 @@ using Volo.Abp.ObjectMapping;
|
||||
|
||||
namespace Yi.Framework.Mapster
|
||||
{
|
||||
/// <summary>
|
||||
/// Mapster对象映射器
|
||||
/// 实现IObjectMapper接口,提供对象映射功能
|
||||
/// </summary>
|
||||
public class MapsterObjectMapper : IObjectMapper
|
||||
{
|
||||
public IAutoObjectMappingProvider AutoObjectMappingProvider => throw new NotImplementedException();
|
||||
private readonly IAutoObjectMappingProvider _autoObjectMappingProvider;
|
||||
|
||||
public TDestination Map<TSource, TDestination>(TSource source)
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
/// <param name="autoObjectMappingProvider">自动对象映射提供程序</param>
|
||||
public MapsterObjectMapper(IAutoObjectMappingProvider autoObjectMappingProvider)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
_autoObjectMappingProvider = autoObjectMappingProvider;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取自动对象映射提供程序
|
||||
/// </summary>
|
||||
public IAutoObjectMappingProvider AutoObjectMappingProvider => _autoObjectMappingProvider;
|
||||
|
||||
/// <summary>
|
||||
/// 将源对象映射到目标类型
|
||||
/// </summary>
|
||||
/// <typeparam name="TSource">源类型</typeparam>
|
||||
/// <typeparam name="TDestination">目标类型</typeparam>
|
||||
/// <param name="source">源对象</param>
|
||||
/// <returns>映射后的目标类型实例</returns>
|
||||
public TDestination Map<TSource, TDestination>(TSource source)
|
||||
{
|
||||
return AutoObjectMappingProvider.Map<TSource, TDestination>(source);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将源对象映射到现有的目标对象
|
||||
/// </summary>
|
||||
/// <typeparam name="TSource">源类型</typeparam>
|
||||
/// <typeparam name="TDestination">目标类型</typeparam>
|
||||
/// <param name="source">源对象</param>
|
||||
/// <param name="destination">目标对象</param>
|
||||
/// <returns>映射后的目标对象</returns>
|
||||
public TDestination Map<TSource, TDestination>(TSource source, TDestination destination)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return AutoObjectMappingProvider.Map(source, destination);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user