|
|
|
|
using GDZZ.Application.Entity;
|
|
|
|
|
using GDZZ.Application.Enum;
|
|
|
|
|
using GDZZ.Core;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace GDZZ.Application.Mapper
|
|
|
|
|
{
|
|
|
|
|
public class Mapper : IRegister
|
|
|
|
|
{
|
|
|
|
|
public void Register(TypeAdapterConfig config)
|
|
|
|
|
{
|
|
|
|
|
config.ForType<LiveMessage, LiveMessageList>()
|
|
|
|
|
.Map(d => d.Content, s => s.Type != "text" ?s.Content: Regex.Unescape(s.Content))
|
|
|
|
|
.Map(d => d.ToContactId, s => s.CreatedUserId);
|
|
|
|
|
|
|
|
|
|
config.ForType<LiveHistoryContacts, LiveHistoryLists>()
|
|
|
|
|
.Map(d => d.Id, s => s.CreatedUserId);
|
|
|
|
|
|
|
|
|
|
config.ForType<Position, PositionOutput> ()
|
|
|
|
|
.Map(d => d.Value, s => s.Id)
|
|
|
|
|
.Map(d=>d.Label,s=>s.PositionName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.ForType<SysRegion, PositionOutput>()
|
|
|
|
|
.Map(d => d.Value, s => s.region_id)
|
|
|
|
|
.Map(d => d.Label, s => s.region_name);
|
|
|
|
|
|
|
|
|
|
config.ForType<Taking, TakingOutput>()
|
|
|
|
|
.Map(t => t.Status, u => u.Status);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|