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

import com.hdkj.lt.bf.entity.FhzgProblemFeedback;
import com.hdkj.lt.bf.entity.dto.ProblemFeedbackUpdateDTO;
import com.hdkj.lt.bf.entity.dto.SwitchInfoUpdateRequest;
import com.hdkj.lt.core.bizms.modle.po.FhzgSwitchProtectionSettings;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import org.springframework.stereotype.Component;

/**
 * @author rj
 * @date 2025/6/27 10:00
 * @description
 */
@Mapper
@Component
public interface DTOToEntityConvertor {

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

    @Mapping(source = "oc1Value", target = "oc1Value")
    @Mapping(source = "oc1Delay", target = "oc1Delay")
    @Mapping(source = "oc1Setting", target = "oc1Setting")
    @Mapping(source = "oc2Value", target = "oc2Value")
    @Mapping(source = "oc2Delay", target = "oc2Delay")
    @Mapping(source = "oc2Setting", target = "oc2Setting")
    @Mapping(source = "oc3Value", target = "oc3Value")
    @Mapping(source = "oc3Delay", target = "oc3Delay")
    @Mapping(source = "oc3Setting", target = "oc3Setting")
    @Mapping(source = "protEnableStatus", target = "protEnableStatus")
    @Mapping(source = "recloseEnableStatus", target = "recloseEnableStatus")
    @Mapping(source = "switchId", target = "devicePrsId")
    @Mapping(source = "hazardType", target = "hazardType")
    @Mapping(source = "hazardDesc", target = "hazardDesc")
    FhzgSwitchProtectionSettings toSwitchInfoUpdateRequest(SwitchInfoUpdateRequest switchInfoUpdateRequest);


    FhzgProblemFeedback toFhzgProblemFeedback(ProblemFeedbackUpdateDTO problemFeedbackUpdateDTO);
}
