12345678910111213141516171819202122232425262728293031323334353637 |
- using Hotline.Orders;
- using Hotline.Share.Dtos.Snapshot;
- 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<AddIndustryDto, Industry>();
- config.ForType<Hotline.File.File, IndustryFileDto>()
- .Map(m => m.AdditionId, n => n.Additions);
- config.ForType<IndustryFileDto, Hotline.File.File>()
- .Map(m => m.Additions, n => n.AdditionId);
- config.ForType<AddSnapshotOrderInDto, Order>()
- .Map(m => m.Contact, n => n.PhoneNumber)
- .Map(m => m.FromName, n => n.Name)
- .Map(m => m.FromPhone, n => n.PhoneNumber);
- config.ForType<SnapshotOrderPublish, OrderPublishDetailOutDto>()
- .Map(m => m.Title, n => n.ArrangeTitle)
- .Map(m => m.Content, n => n.ArrangeContent)
- .Map(m => m.Opinion, n => n.ArrangeOpinion);
- config.ForType<Order, OrderPublishDetailOutDto>()
- .Map(m => m.Opinion, n => n.ActualOpinion);
- }
- }
|