using AngleSharp.Text; using Hotline.Orders; using Hotline.Share.Dtos.Snapshot; using Hotline.Share.Enums.Order; using Hotline.Share.Tools; using Hotline.Snapshot; using Mapster; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Hotline.Application.Mappers; public class SnapshotMapperConfigs : IRegister { public void Register(TypeAdapterConfig config) { config.ForType() .Map(dest => dest.Name, src => src.OrgName) .Map(dest => dest.ParentCode, src => src.ParentOrgId) .Map(dest => dest.Id, src => src.OrgId) .Map(dest => dest.FullName, src => src.OrgFullName) .AfterMapping((dest, src) => { src.Id = dest.OrgId; }); config.ForType(); config.ForType() .Map(m => m.AdditionId, n => n.Additions); config.ForType() .Map(m => m.Additions, n => n.AdditionId); config.ForType() .Map(m => m.Contact, n => n.PhoneNumber) .Map(m => m.FromName, n => n.Name) .Map(m => m.FromPhone, n => n.PhoneNumber); config.ForType() .Map(m => m.Title, n => n.ArrangeTitle) .Map(m => m.Content, n => n.ArrangeContent) .Map(m => m.Opinion, n => n.ArrangeOpinion); config.ForType() .Map(m => m.Opinion, n => n.ActualOpinion); config.ForType() .Ignore(m => m.Gender); config.ForType() .Map(m => m.ReplyDate, n => n.ReplyDate) .Map(m => m.ReplyUserName, n => n.ReplyUserName) .Map(m => m.ReplyBMName, n => n.ReplyBMName) .Map(m => m.ReplyResultType, n => n.ReplyResultType) .Map(m => m.IsTruth, n => n.ReplyISTrue == "1") .Map(m => m.IsDeal, n => n.ReplyResultType == "2") .Map(m => m.IsRepetition, n => n.IsRepeat == "1") .Map(m => m.IsDanger, n => n.IsHiddenDanger == "1") .Map(m => m.MemberName, n => n.MemberName) .Map(m => m.MemberMobile, n => n.MemberMobile) .Map(m => m.CommunityId, n => n.OrgId) .Map(m => m.NetworkRemark, n => n.ReplyContent); } }