package com.hdkj.lt.mq.entity.convert;

import com.hdkj.lt.core.bizms.modle.po.operationAbnormality.FhzgOperationAbnormalityEvent;
import com.hdkj.lt.core.bizms.modle.po.operationAbnormality.FhzgOperationAbnormalityEventFeeder;
import com.hdkj.lt.modle.dto.abnormal.AbnormalMessageDataDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author rj
 * @date 2025/6/27 9:57
 * @description
 */
@Component
@Mapper
public interface MQEntityToVOConvertor {

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

    @Mapping(source = "list", target = "feeders")
    @Mapping(source = "event.eventId", target = "id")
    AbnormalMessageDataDTO toAbnormalMessageDataDTO(FhzgOperationAbnormalityEvent event, List<FhzgOperationAbnormalityEventFeeder> list);
}
