2 3 - 迁移 IMqttServiceManager 接口到 DMS.Core 4 - 在 DataCenterService 中添加 MQTT 服务器和变量别名的加载逻辑 5 - 实现 MqttPublishProcessor 的核心处理逻辑 6 - 为 DTO 和 ViewModel 的 MqttAliases 属性提供默认空列表初始化 7 - 更新 AutoMapper 映射配置以支持 VariableMqttAliasDto
34 lines
1.3 KiB
C#
34 lines
1.3 KiB
C#
using AutoMapper;
|
|
using DMS.Application.DTOs;
|
|
using DMS.Core.Models;
|
|
using DMS.Infrastructure.Models;
|
|
using DMS.WPF.ViewModels.Items;
|
|
|
|
namespace DMS.WPF.Profiles
|
|
{
|
|
public class MappingProfile : Profile
|
|
{
|
|
public MappingProfile()
|
|
{
|
|
CreateMap<DeviceDto, DeviceItemViewModel>()
|
|
.ReverseMap();
|
|
CreateMap<Variable, VariableItemViewModel>()
|
|
.ReverseMap();
|
|
CreateMap<OpcUaNode, OpcUaNodeItemViewModel>()
|
|
.ReverseMap();
|
|
CreateMap<VariableItemViewModel, VariableItemViewModel>();
|
|
CreateMap<VariableMqttAliasDto, VariableMqttAliasItemViewModel>().ReverseMap();
|
|
|
|
|
|
CreateMap<MenuBeanDto, MenuItemViewModel>()
|
|
.ReverseMap();
|
|
|
|
CreateMap<MqttServerDto, MqttServerItemViewModel>().ReverseMap();
|
|
CreateMap<UserDto, UserItemViewModel>().ReverseMap();
|
|
CreateMap<VariableHistoryDto, VariableHistoryItemViewModel>().ReverseMap();
|
|
CreateMap<VariableDto, VariableItemViewModel>().ReverseMap();
|
|
CreateMap<VariableMqttAliasDto, VariableMqttAliasItemViewModel>().ReverseMap();
|
|
CreateMap<VariableTableDto, VariableTableItemViewModel>().ReverseMap();
|
|
}
|
|
}
|
|
} |