Waste/Waste.Application/Mapper.cs

24 lines
705 B
C#
Raw Normal View History

2021-05-27 16:58:40 +08:00
using Mapster;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Waste.Domain;
namespace Waste.Application
{
public class Mapper : IRegister
{
public void Register(TypeAdapterConfig config)
{
config.ForType<ApiReportBaseDataItem, ApiReportBaseData>()
.Map(dest => dest.weight, src => src.DayWeight.ToString("f2"))
.Map(dest => dest.pweight, src => src.DayPureWeight.ToString("f2"))
.Map(dest=>dest.time,src=>src.CreateTime.ToString("yyyy-MM-dd"))
.Map(dest=>dest.type,src=>src.WasteType)
;
2021-05-27 16:58:40 +08:00
}
}
}