88 lines
3.4 KiB
C#
88 lines
3.4 KiB
C#
using AutoMapper;
|
|
using IRaCIS.Application.Contracts;
|
|
using IRaCIS.Core.Application.Contracts;
|
|
using IRaCIS.Core.Application.ViewModel;
|
|
using IRaCIS.Core.Domain.Models;
|
|
using IRaCIS.Core.Domain.Share;
|
|
|
|
namespace IRaCIS.Core.Application.Service
|
|
{
|
|
public class CommonConfig : Profile
|
|
{
|
|
public CommonConfig()
|
|
{
|
|
CreateMap<Message, SysMessageDTO>()
|
|
.ForMember(o => o.MessageTime, t => t.MapFrom(u => u.MessageTime.ToString()));
|
|
|
|
CreateMap<SystemLog, SystemLogDTO>();
|
|
|
|
CreateMap<SystemLogDTO, SystemLog>();
|
|
|
|
CreateMap<FrontAuditConfig, FrontAuditConfigAddOrEdit>().ReverseMap();
|
|
|
|
CreateMap<EmailNoticeConfigAddOrEdit, EmailNoticeConfig>().ReverseMap();
|
|
|
|
|
|
CreateMap<EmailNoticeUserType, EmailUserTypeDto>();
|
|
|
|
|
|
var trialId = Guid.Empty;
|
|
CreateMap<EmailNoticeConfig, TrialSelectEmailNoticeConfigView>().IncludeBase<EmailNoticeConfig, EmailNoticeConfigView>()
|
|
.ForMember(o => o.IsHaveSelected, t => t.MapFrom(u => u.TrialEmailNoticeConfigList.Any(c=>c.TrialId==trialId && c.SysEmailNoticeConfigId==u.Id)))
|
|
;
|
|
|
|
CreateMap<EmailNoticeConfig, EmailNoticeConfigView>()
|
|
.ForMember(t => t.EmailNoticeUserList, u => u.MapFrom(c => c.EmailNoticeUserTypeList));
|
|
|
|
CreateMap<Dictionary, DicView>()
|
|
.ForMember(t => t.ParentCode, u => u.MapFrom(c => c.Parent.Code));
|
|
CreateMap<SystemBasicData, SystemBasicDataView>();
|
|
|
|
var isEn_Us = false;
|
|
CreateMap<SystemBasicData, SystemBasicDataSelect>()
|
|
.ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code))
|
|
.ForMember(o => o.Value, t => t.MapFrom(u => isEn_Us? u.Value:u.ValueCN));
|
|
|
|
CreateMap<SystemBasicDataAddOrEdit, SystemBasicData>().ReverseMap();
|
|
|
|
|
|
|
|
CreateMap<Dictionary, BasicDicView>()
|
|
.ForMember(o => o.ConfigType, t => t.MapFrom(u => u.ConfigDictionary.Code));
|
|
|
|
CreateMap<AddOrEditBasicDic, Dictionary>().ReverseMap();
|
|
|
|
|
|
CreateMap<AddBasicDicAndChild, Dictionary>().ForMember(o => o.ChildList, t => t.Ignore());
|
|
CreateMap<AddBasicDicChild, Dictionary>();
|
|
|
|
CreateMap<Dictionary, BasicDicSelectCopy>()
|
|
.ForMember(o => o.ParentChildCodeEnum, t => t.MapFrom(u => u.Parent.ChildCodeEnum))
|
|
.ForMember(o => o.Value, t => t.MapFrom(u => u.MappedValue))
|
|
.ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code));
|
|
|
|
CreateMap<Dictionary, BasicDicSelect>()
|
|
.ForMember(o => o.ParentChildCodeEnum, t => t.MapFrom(u => u.Parent.ChildCodeEnum))
|
|
.ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code));
|
|
|
|
var token = "";
|
|
CreateMap<CommonDocument, CommonDocumentView>()
|
|
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
|
|
|
|
CreateMap<CommonDocument, CommonDocumentAddOrEdit>().ReverseMap();
|
|
|
|
CreateMap<Internationalization, InternationalizationView>();
|
|
CreateMap<Internationalization, InternationalizationAddOrEdit>().ReverseMap();
|
|
|
|
CreateMap<BatchAddInternationalizationDto, InternationalizationAddOrEdit>();
|
|
|
|
|
|
CreateMap<PublishLog, PublishLogView>();
|
|
CreateMap<PublishLog, PublishLogAddOrEdit>().ReverseMap();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
}
|