package cd.casic.ci.process.process.converter;

import cd.casic.ci.process.dto.req.target.TargetManagerCreateReq;
import cd.casic.ci.process.dto.req.target.TargetManagerUpdateReq;
import cd.casic.ci.process.dto.resp.target.TargetManagerResp;
import cd.casic.ci.process.process.dataObject.target.TargetManager;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author HopeLi
 * @version v1.0
 * @ClassName PipelineConverter
 * @Date: 2025/5/13 14:39
 * @Description:
 */
@Mapper(componentModel = "spring")
public interface TargetConverter {
    TargetConverter INSTANCE = Mappers.getMapper(TargetConverter.class);

    TargetManagerResp toResp(TargetManager targetManager);
    List<TargetManagerResp> toRespList(List<TargetManager> targetManagers);

    TargetManager createReqToBean(TargetManagerCreateReq req);

    void updateReqToBean(TargetManagerUpdateReq req,@MappingTarget TargetManager targetManager);
}
