package org.jeecg.modules.largeScreen.convert;

import org.jeecg.modules.itdmDeviceStart.entity.ItdmDeviceStart;
import org.jeecg.modules.largeScreen.vo.ItdmAlarmNowWSVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
import org.springframework.util.CollectionUtils;

import java.util.stream.Collectors;

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE,imports ={ CollectionUtils.class, Collectors.class})
public interface ItdmDeviceStartConvert {

    ItdmDeviceStartConvert INSTANCE = Mappers.getMapper(ItdmDeviceStartConvert.class);

    /**设备启动报警*/
    @Mapping(target = "alarmMessage", source = "alarmMessage")//报警信息
    @Mapping(target = "alarmType", source = "alarmType")//数据类型（1数据报警 2通电变温预警 3设备启动报警）
    ItdmAlarmNowWSVO convert(ItdmDeviceStart itdmDeviceStart, Integer alarmType, String alarmMessage);

}
