using JNPF.Common.Models; using JNPF.Common.Models.VisualDev; using JNPF.Common.Security; using Mapster; namespace JNPF.VisualDev.Engine.Mapper; internal class VisualDev : IRegister { public void Register(TypeAdapterConfig config) { config.ForType() .Map(dest => dest.jnpfKey, src => src.__config__.jnpfKey) .Map(dest => dest.format, src => src.format) .Map(dest => dest.multiple, src => src.multiple) .Map(dest => dest.searchType, src => src.searchType) .Map(dest => dest.vModel, src => src.__vModel__); config.ForType() .Map(dest => dest.__config__, src => src.__config__.ToObject()) .Map(dest => dest.__slot__, src => string.IsNullOrEmpty(src.__slot__) ? null : src.__slot__.ToObject()) .Map(dest => dest.props, src => string.IsNullOrEmpty(src.props) ? null : src.props.ToObject()) .Map(dest => dest.options, src => string.IsNullOrEmpty(src.options) ? null : src.options.ToObject>()) .Map(dest => dest.ableDepIds, src => string.IsNullOrEmpty(src.ableDepIds) ? null : src.ableDepIds.ToObject>()) .Map(dest => dest.ablePosIds, src => string.IsNullOrEmpty(src.ablePosIds) ? null : src.ablePosIds.ToObject>()) .Map(dest => dest.ableUserIds, src => string.IsNullOrEmpty(src.ableUserIds) ? null : src.ableUserIds.ToObject>()) .Map(dest => dest.ableRoleIds, src => string.IsNullOrEmpty(src.ableRoleIds) ? null : src.ableRoleIds.ToObject>()) .Map(dest => dest.ableGroupIds, src => string.IsNullOrEmpty(src.ableGroupIds) ? null : src.ableGroupIds.ToObject>()) .Map(dest => dest.ableIds, src => string.IsNullOrEmpty(src.ableIds) ? null : src.ableIds.ToObject>()); } }